We are about to switch to a new forum software. Until then we have removed the registration on this forum.
This would mean that the objects would function as a union, and when one is translated the other one follows exactly. I need this to create a sort of navigation in a processing sketch, to move a background-covering rect(0, 0, width*1000, height) with all the stuff over it that has been allready drawn.
Answers
i really want to make a navigation, otherwise the drawing would happen in real-time and I wouldn't be able to see it happening.
You could either say translate.....
and then draw all that belongs together
Or you let the background and all things use the same variable that tells the value for translation. Here all stuff is with pushMatrix popMatrix
translate()
already does this -- everything after it is called is "bound together." More generally, the matrix stack already does this for translation, rotation, scaling, etc. When you shift, everything that you render shifts. You can "bind / unbind" things with pushMatrix, popMatrix.See the tutorial 2D Transformations, in particular the Transformation Matrix section, and this related discussion.
See also: