Namespace: geom

game.add.geom

Adds geometric shapes.
Source:

Methods

(static) arc(x, y, diameter, angleStart, angleEnd, anticlockwise, lineColor, lineWidth, fillColor, alpha) → {object}

Adds arc to media queue.
Parameters:
Name Type Description
x number x coordinate for the arc center
y number y coordinate for the arc center
diameter number arc diameter
angleStart number angle to start the arc
angleEnd number angle to end the arc
anticlockwise undefined | boolean if true, arc is created anticlockwise (default = false)
lineColor undefined | string stroke color (default = black)
lineWidth undefined | number stroke width (default = 1px)
fillColor undefined | string fill color (default = no fill)
alpha undefined | number level of transparency, from 0 (invisible) to 1 (100% visible)) (default = 1)
Source:
Returns:
a reference to the created arc.
Type
object

(static) circle(x, y, diameter, lineColor, lineWidth, fillColor, alpha) → {object}

Adds circle to media queue.
Parameters:
Name Type Description
x number x coordinate for the circle center
y number y coordinate for the circle center
diameter number circle diameter (default = 50)
lineColor undefined | string stroke color (default = black)
lineWidth undefined | number stroke width (default = 1px)
fillColor undefined | string fill color (default = no fill)
alpha undefined | number level of transparency, from 0 (invisible) to 1 (100% visible)) (default = 1)
Source:
Returns:
a reference to the created circle.
Type
object

(static) rect(x, y, width, height, lineColor, lineWidth, fillColor, alpha) → {object}

Adds rectangle to media queue.
Parameters:
Name Type Description
x number x coordinate for top left corner of the rectangle
y number y coordinate for top left corner of the rectangle
width number rectangle width (default = 50)
height undefined | number rectangle height (default = 50)
lineColor undefined | string stroke color (default = black)
lineWidth undefined | number stroke width (default = 1px)
fillColor undefined | string fill color (default = no fill)
alpha undefined | number level of transparency, from 0 (invisible) to 1 (100% visible)) (default = 1)
Source:
Returns:
a reference to the created rectangle.
Type
object