Class: LineRenderable

LineRenderable

new LineRenderable(x1, y1, x2, y2) → {LineRenderable}

Default Constructor

Renderable objects for lines

p1, p2: either both there, or none

Parameters:
Name Type Description
x1 Number X position of point 1
y1 Number Y position of point 1
x2 Number X position of point 2
y2 Number Y position of point 2
Source:
Returns:
New instance of LineRenderable
Type
LineRenderable

Methods

draw(aCamera) → {void}

Draw function called by GameLoop
Parameters:
Name Type Description
aCamera Camera to draw the Renderable to
Source:
Returns:
Type
void

setDrawVertices(s) → {void}

Sets the Draw Verticies state of LineRenderable
Parameters:
Name Type Description
s Boolean new draw verticies state
Source:
Returns:
Type
void

setFirstVertex(x, y) → {void}

Set the first vertice point
Parameters:
Name Type Description
x Number X position of point 1
y Number Y position of point 1
Source:
Returns:
Type
void

setPointSize(s) → {void}

Set the point size of LineRenderable
Parameters:
Name Type Description
s Number new point size
Source:
Returns:
Type
void

setSecondVertex(x, y) → {void}

Set the second vertice point
Parameters:
Name Type Description
x Number X position of point 2
y Number Y position of point 2
Source:
Returns:
Type
void

setShowLine(s) → {void}

Set the Show Line state of LineRenderable
Parameters:
Name Type Description
s Boolean new show line state
Source:
Returns:
Type
void

setVertices(x1, y1, x2, y2) → {void}

Set the vertice drawing points
Parameters:
Name Type Description
x1 type X position of point 1
y1 type Y position of point 1
x2 type X position of point 2
y2 type Y position of point 2
Source:
Returns:
Type
void