Graphics

Graphics

Methods


create_graphics_object(x, y)


Adds a graphics object to use to draw primitive shapes.

Check out the third party documentation for a more in depth explanation.

Parameters:
Name Type Description
x Number

x position of the new graphics object

y Number

y position of the new graphics object

Code Equivalent:
game.add.graphics(value_x, value_y)

draw_circle(x, y, diameter)


Draws a circle. Use inside of draw_shapes_with_colour

Check out the third party documentation for a more in depth explanation.

Parameters:
Name Type Description
x Number

x position of the rectangle

y Number

y position of the rectangle

diameter Number

the diameter of the rectangle

Code Equivalent:
variable_graphics_object_name.drawCircle(value_x, value_y, value_diameter);

draw_rectangle(x, y, width, height)


Draws a rectangle. Use inside of draw_shapes_with_colour

Check out the third party documentation for a more in depth explanation.

Parameters:
Name Type Description
x Number

x position of the rectangle

y Number

y position of the rectangle

width Number

the width of the rectangle

height Number

the height of the rectangle

Code Equivalent:
variable_graphics_object_name.drawRect(value_x, value_y, value_w, value_h);

draw_shapes_with_colour(colour, graphics)

Parameters:
Name Type Description
colour

the colour to fill the shapes with

graphics

the graphics object to use

Code Equivalent:
`