Alpha is lost on textured shapes.
in
Android Processing
•
8 months ago
Hi all !
I use a texture as a sprite map (it will be a font in the end).
My code work OK in java mode but in Android mode I lose the alpha so I get some black filled part instead of tansparency.
code is like this:
- fonte_img = loadImage("fonte3.gif"); // same with a png
...
main assignment loop (c is the char number done in a for loop):
- fontShape[c] = createShape();
- fontShape[c].noFill();
- fontShape[c].noStroke();
- fontShape[c].translate(0,0,1); // I had to add this to avoid my background masking these shapes => this is another bug (Z sorting is OK in JAVA and not in Android mode)
- fontShape[c].texture(fonte_img);
- fontShape[c].vertex(-1.0*char_width, -1.0*char_height, 0, src_x, src_y);
- fontShape[c].vertex(char_width, -1.0*char_height, 0,src_x+src_w, src_y);
- fontShape[c].vertex(char_width, char_height, 0, src_x+src_w, src_y+src_h);
- fontShape[c].vertex(-1.0*char_width, char_height, 0,src_x,src_y+src_h);
- fontShape[c].end(CLOSE);
Cheers !
Olivier
1