実例 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.