new BoxRendererComponent(pWidth, pHeight, pColor, pOwner)
The box renderer component is used to associate a box of a given color to a
game object.
Parameters:
Name | Type | Description |
---|---|---|
pWidth |
int | The width of the box to render. |
pHeight |
int | The height of the box to render. |
pColor |
string | Color of the box to render. |
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
-
destroy()
-
Destroy the component and its objects.
-
draw(bufferContext, newPosition)
-
Draw the box.
Parameters:
Name Type Description bufferContext
CanvasRenderingContext2D Context on which drawing is done. newPosition
FM.Vector Position of the box to render. -
getAlpha() → {float}
-
Retrieve the transparency value of the box.
Returns:
Current transparency value.- Type
- float
-
getColor() → {string}
-
Retrieve the color of the box.
Returns:
Color of the box.- Type
- string
-
getHeight() → {int}
-
Retrieve the height of the box.
Returns:
Height of the box.- Type
- int
-
getWidth() → {int}
-
Retrieve the width of the box.
Returns:
Width of the box.- Type
- int
-
setAlpha(pNewAlpha)
-
Set the transparency of the box.
Parameters:
Name Type Description pNewAlpha
float New transparency value desired. -
setColor(pNewColor)
-
Set the color of the box.
Parameters:
Name Type Description pNewColor
string New color desired. -
setHeight(pNewHeight)
-
Set the height of the box.
Parameters:
Name Type Description pNewHeight
int New height desired. -
setWidth(pNewWidth)
-
Set the width of the box.
Parameters:
Name Type Description pNewWidth
int New width desired.