Modifies the location from which shapes draw.
1def setup(): 2 global bot 3 bot = py5.load_shape("bot.svg") 4 5 6def draw(): 7 py5.shape_mode(py5.CENTER) 8 py5.shape(bot, 35, 35, 50, 50) 9 py5.shape_mode(py5.CORNER) 10 py5.shape(bot, 35, 35, 50, 50)
Modifies the location from which shapes draw. The default mode is
shape_mode(CORNER), which specifies the location to be the upper left corner of the shape and uses the third and fourth parameters of shape() to specify the width and height. The syntax
shape_mode(CORNERS) uses the first and second parameters of shape() to set the location of one corner and uses the third and fourth parameters to set the opposite corner. The syntax
shape_mode(CENTER) draws the shape from its center point and uses the third and forth parameters of shape() to specify the width and height. The parameter must be written in ALL CAPS because Python is a case sensitive language.
Underlying Processing method: shapeMode
shape_mode(mode: int, /) -> None
mode: int - either CORNER, CORNERS, CENTER
Updated on November 12, 2021 11:30:58am UTC