Class: BoxRendererComponent

BoxRendererComponent

FM.BoxRendererComponent

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.
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

destroy()

Destroy the component and its objects.
Source:

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.
Source:

getAlpha() → {float}

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

getColor() → {string}

Retrieve the color of the box.
Source:
Returns:
Color of the box.
Type
string

getHeight() → {int}

Retrieve the height of the box.
Source:
Returns:
Height of the box.
Type
int

getWidth() → {int}

Retrieve the width of the box.
Source:
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.
Source:

setColor(pNewColor)

Set the color of the box.
Parameters:
Name Type Description
pNewColor string New color desired.
Source:

setHeight(pNewHeight)

Set the height of the box.
Parameters:
Name Type Description
pNewHeight int New height desired.
Source:

setWidth(pNewWidth)

Set the width of the box.
Parameters:
Name Type Description
pNewWidth int New width desired.
Source: