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. |
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. -
clear()
-
Reset the lines.
-
destroy()
-
Destroy the component and its objects.
-
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. -
getAlpha() → {float}
-
Retrieve the transparency value of the line.
Returns:
Current transparency value.- Type
- float
-
getHeight() → {int}
-
Retrieve the height of the line(distance from start to end).
Returns:
The height of the line.- Type
- int
-
getLineStyle() → {string}
-
Retrieve the style of the line.
Returns:
The style of the line.- Type
- string
-
getLineWidth() → {int}
-
Retrieve the width of the line (weight).
Returns:
The width of the line.- Type
- int
-
getWidth() → {int}
-
Retrieve the width of the line (distance from start to end).
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. -
setLineStyle(pNewLineStyle)
-
Set the style of the line.
Parameters:
Name Type Description pNewLineStyle
string New line style desired. -
setLineWidth(pNewLineWidth)
-
Set the width of the line (weight).
Parameters:
Name Type Description pNewLineWidth
int New line width desired.