top of page

Draw (PE.Draw)

PE.Draw.init(screen_size_)

automated function, updates global data

​

function actions:

update render resolution

​

function usage:

used by PE.init() function to update render resolution.

​

parameters:

screen_size_ - new render resolution

PE.Draw.draw_rect(win: pygame.Surface, pos=(0, 0), size=(10, 10), color=(0, 0, 255), border=5, rot=0)

function actions:

draw a rectangle on a surface.

​

parameters:

win - the surface to draw the rectangle on it (pygame.Surface)

pos - the position of the rectangle (vector 2 like)

size - the size of the rectangle (vector 2 like)

color - the color of the rectangle (color 3 like / color 4 like)

border - the width of the border of the rectangle (int)

rot - the rotation of the rectangle (int)

​

recommended place in script:

in the render zone (between the frame fill and the frame update)

PE.Draw.draw_circle(win: pygame.Surface, pos=(0, 0), radius=0, color=(0, 0, 255), border=5)

function actions:

draw a circle on a surface.

​

parameters:

win - the surface to draw the circle on it (pygame.Surface)

pos - the position of the circle (vector 2 like)

radius - the radius of the circle (int)

color - the color of the circle (color 3 like / color 4 like)

border - the width of the border of the circle (int)

​

recommended place in script:

in the render zone (between the frame fill and the frame update)

PE.Draw.draw_ellipse(win: pygame.Surface, pos=(0, 0), size=(10, 10),color=(0, 0, 255), border=5)

function actions:

draw a circle on a surface but instead of using circular transform (radius - vector1) you can use rectangle transform (vector2)

​

parameters:

win - the surface to draw the circle on it (pygame.Surface)

pos - the position of the circle (vector 2 like)

size - the size of the rect transform of the circle (vector 2 like)

color - the color of the circle (color 3 like / color 4 like)

border - the width of the border of the circle (int)

​

recommended place in script:

in the render zone (between the frame fill and the frame update)

PE.Draw.draw_line(win: pygame.Surface, pos1=(0, 0), pos2=(10, 10), color=(0, 0, 255), size=5)

function actions:

draw a line between 2 points on a surface

​

parameters:

win - the surface to draw the line on it (pygame.Surface)

pos1 - the position of one of the dots (vector 2 like)

pos2 - the position of the another dot (vector 2 like)

size - the width of the line (int)

color - the color of the circle (color 3 like / color 4 like)

​

recommended place in script:

in the render zone (between the frame fill and the frame update)

PE.Draw.draw_shape(win: pygame.Surface, pos=(0, 0), points=((0, 0), (10, 10)), color=(0, 0, 255), border=5, rot=0)

function actions:

draw a custom shape.

​

parameters:

win - the surface to draw the shape on (pygame.Surface)

pos - the position of the shape (vector 2 like)

points - the list of the vertices of the shape (list like of vector 2 like) 

border - the width of the border (int)

color - the color of the shape (color 3 like / color 4 like)

rot - the rotation of the shape (int)

​

recommended place in script:

in the render zone (between the frame fill and the frame update)

Powered and secured by Wix © 2035

bottom of page