Class: DrawObjectFactory

DrawObjectFactory()

Creates drawObjects instances.
accessible via ScreenPage.draw

Constructor

new DrawObjectFactory()

Source:
See:

Methods

circle(radius, bgColor) → {DrawCircleObject}

Parameters:
Name Type Description
radius number
bgColor string rgba(r,g,b,a)
Source:
Returns:
Type
DrawCircleObject

conus(radius, bgColor, angleopt, fadeopt) → {DrawConusObject}

Parameters:
Name Type Attributes Default Description
radius number
bgColor string rgba(r,g,b,a)
angle number <optional>
fade number <optional>
0 (0 - 1)
Source:
Returns:
Type
DrawConusObject

image(x, y, width, height, key, imageIndexopt, boundaries) → {DrawImageObject}

Parameters:
Name Type Attributes Default Description
x number
y number
width number
height number
key string
imageIndex number <optional>
0
boundaries Array.<{x:Number, y:Number}> | Object boundaries as polygon, or circle
Source:
Returns:
Type
DrawImageObject

line(vertices, color) → {DrawLineObject}

Parameters:
Name Type Description
vertices Array.<number>
color string rgba(r,g,b,a)
Source:
Returns:
Type
DrawLineObject

polygon(vertices, bgColor) → {DrawPolygonObject}

Parameters:
Name Type Description
vertices Array.<{x:number, y:number}> should go in anticlockwise order
bgColor string rgba(r,g,b,a)
Source:
Returns:
Type
DrawPolygonObject

rect(x, y, width, height, backgroundColor) → {DrawRectObject}

Parameters:
Name Type Description
x number
y number
width number
height number
backgroundColor string rgba(r,g,b,a)
Source:
Returns:
Type
DrawRectObject

text(x, y, text, font, color) → {DrawTextObject}

Parameters:
Name Type Description
x number
y number
text string
font string size fontFamily
color string rgba(r,g,b,a)
Source:
Returns:
Type
DrawTextObject