Class: LineRendererComponent

LineRendererComponent

FM.LineRendererComponent

new LineRendererComponent(pLineWidth, pLineStyle, pOwner)

The line renderer component is used to render a line associated to a game object.
Parameters:
Name Type Description
pLineWidth int Width of the line to render.
pLineStyle string The style of the line to draw.
pOwner FM.GameObject The game object that owns this component.
Author:
  • Simon Chauvin
Source:

Extends

Members

name :FM.ComponentTypes

Component's name.
Type:
Inherited From:
Source:

owner :FM.GameObject

Component's owner.
Type:
Inherited From:
Source:

Methods

addPoint(pNewPoint)

Add a point to the line to be drawn.
Parameters:
Name Type Description
pNewPoint FM.Vector The new point to add.
Source:

clear()

Reset the lines.
Source:

destroy()

Destroy the component and its objects.
Source:

draw(bufferContext, newPosition)

Draw the line.
Parameters:
Name Type Description
bufferContext CanvasRenderingContext2D Context on which drawing is done.
newPosition FM.Vector Position of the line to render.
Source:

getAlpha() → {float}

Retrieve the transparency value of the line.
Source:
Returns:
Current transparency value.
Type
float

getHeight() → {int}

Retrieve the height of the line(distance from start to end).
Source:
Returns:
The height of the line.
Type
int

getLineStyle() → {string}

Retrieve the style of the line.
Source:
Returns:
The style of the line.
Type
string

getLineWidth() → {int}

Retrieve the width of the line (weight).
Source:
Returns:
The width of the line.
Type
int

getWidth() → {int}

Retrieve the width of the line (distance from start to end).
Source:
Returns:
The width of the line.
Type
int

setAlpha(pNewAlpha)

Set the transparency of the line.
Parameters:
Name Type Description
pNewAlpha float New transparency value desired.
Source:

setLineStyle(pNewLineStyle)

Set the style of the line.
Parameters:
Name Type Description
pNewLineStyle string New line style desired.
Source:

setLineWidth(pNewLineWidth)

Set the width of the line (weight).
Parameters:
Name Type Description
pNewLineWidth int New line width desired.
Source: