pop() function restores the previous drawing style settings and transformations after Py5Graphics.push() has changed them.
pop() function restores the previous drawing style settings and transformations after Py5Graphics.push() has changed them. Note that these functions are always used together. They allow you to change the style and transformation settings and later return to what you had. When a new state is started with Py5Graphics.push(), it builds on the current style and transform information.
Py5Graphics.push() stores information related to the current transformation state and style settings controlled by the following functions: Py5Graphics.rotate(), Py5Graphics.translate(), Py5Graphics.scale(), Py5Graphics.fill(), Py5Graphics.stroke(), Py5Graphics.tint(), Py5Graphics.stroke_weight(), Py5Graphics.stroke_cap(), Py5Graphics.stroke_join(), Py5Graphics.image_mode(), Py5Graphics.rect_mode(), Py5Graphics.ellipse_mode(), Py5Graphics.color_mode(), Py5Graphics.text_align(), Py5Graphics.text_font(), Py5Graphics.text_mode(), Py5Graphics.text_size(), and Py5Graphics.text_leading().
The Py5Graphics.push() and
pop() functions can be used in place of Py5Graphics.push_matrix(), Py5Graphics.pop_matrix(),
pop_styles(). The difference is that Py5Graphics.push() and
pop() control both the transformations (rotate, scale, translate) and the drawing styles at the same time.
Underlying Java method: PGraphics.pop
pop() -> None
Updated on September 23, 2021 09:34:27am UTC