We are about to switch to a new forum software. Until then we have removed the registration on this forum.
Could anybody explain how to put the text string with autoclear over the animation another object without autoclear at the same time? Is this possible? I have added string, but it has been overlapped by animation. If I put it into void draw() section it spoils without auto clear.
Answers
I am not sure I understand.
can you show your code please?
you wrote:
is there an AND missing?
Rule
When you are working in 2D and not in 3D the last thing drawn on the canvas is on top.
So you want to draw your text at the end of draw() after you have drawn the animation.
Question
With autoclear you mean background(0); at the start of the function
draw()
?Idea
When you don't use background(0); you could draw a rect behind the text to make the text clear
Thanks for the answer, Chrisir.
Sorry, I have missed OF
Yes, I mean all objects are redrawn. I have the animation of the rectangle and the text "Hello Strings!". I want to put the text over the rectangle animation without text redrawn. Now the text is constantly redrawn and has a spoiled edge.
But if I put it into setup, it is overlapped by rectangle.
Hooray, it is working! Thank you!
As said, your text is on top when you use the
text()
at the end of draw().To isolate the rotation of the rectangle from the rest, I used pushMatrix and popMatrix - see reference https://www.processing.org/reference/
I use
background(255, 204, 0);
at start of draw() as it is with most animations in processing.Oh, I hurried. it's not really what I wanted. Animation of rectangle should have been remain, without background redraw. I mean this picture https://www.dropbox.com/s/fmlggvqagatba85/Screen Shot 2017-10-29 at 9.38.47 PM.png?dl=0
Maybe It would be better to use image of text and mask in this case? https://processing.org/examples/alphamask.html
you can also use PGraphics pg, draw rects into that
display pg with image() and draw text over it
Thanks, I'll try it
Did you try this:
Yeah, https://www.dropbox.com/s/otfdlvx7zji1od7/Screen Shot 2017-10-30 at 7.30.05 AM.png?dl=0, the text has spoiled ragged edges because of repeating, it doesn't suit.
I see