We are about to switch to a new forum software. Until then we have removed the registration on this forum.
Hello, I try to show text and lines, but the text should be in the foreground. This does not work. The text is always drawn behind the lines.
I use the OPENGL renderer, because of the fast performance and I have Android 4.4.2.
Here is the code:
void setup()
{
size(720, 1280, OPENGL);
}
void draw()
{
# First draw the line
stroke(#FF0000);
strokeWeight(10.0);
line(0, 0, 500, 500);
# Then draw the text
textSize(37);
text("Hello", 80, 100);
}
Does anyone know, how to change this? I want to have the text in the foreground and not in the background.
Thanks in advance, SimpleProgrammer.
Answers
Comment signs are wrong (// instead of #). Sorry for that.
there's an optimisation that is applied by default that bundles all lines together in one VBO and draws them all together. it sometimes interferes with drawing order. you can turn it off but performance will decrease.
here's one i prepared earlier:
https://forum.processing.org/two/discussion/16849/android-pshape-and-draw-order
It works. But it has really a big impact to the performance.
Thanks for the hint.