Examples Translate

Translate

The translate() function moves the origin of the coordinate system to the specified location.

The push() and pop() functions save and restore the coordinate system and various other drawing settings, such as the fill color.

Note that in this example, we draw the shapes (rectangle and circle) each time in a different coordinate system.

Contributors: Christopher Coleman, Animesh Sinha, Katie, Caleb Foss, Darren Kessner

Modified from Translate.

Originally ported from the Processing example Translate.

Translate is licensed under CC BY-NC-SA 4.0.