new Renderable() → {Renderable}
Default Constructor.
Default Constructor creates an instance of Renderable.
Encapsulate the Shader and VertexBuffer into the same object (and will include
other attributes later) to represent a Renderable object on the game screen.
- Source:
Returns:
a new instance of Renderable.
- Type
- Renderable
Methods
_setShader(s) → {void}
Sets the Renderable's Shader
Parameters:
Name | Type | Description |
---|---|---|
s |
SimpleShader | Shader to set for the Renderable |
- Source:
Returns:
- Type
- void
draw(aCamera) → {void}
Draws the Renderable to the screen in the aCamera viewport.
Parameters:
Name | Type | Description |
---|---|---|
aCamera |
Camera | Camera object to draw to. |
- Source:
Returns:
- Type
- void
getColor() → {Array.<float>}
Gets the Color of the Renderable.
- Source:
Returns:
The color of the Renderable.
- Type
- Array.<float>
getXform() → {Transform}
Returns the Renderable's Transform.
- Source:
Returns:
the Transform of the Renderable.
- Type
- Transform
setColor(color) → {void}
Sets the Color of the Renderable.
Parameters:
Name | Type | Description |
---|---|---|
color |
Array.<float> | The desired Color of the Renderable. |
- Source:
Returns:
- Type
- void
swapShader(s) → {SimpleShader}
Swap the Renderable's Shader.
Sets the Renderable's shader and returns the previous shader.
Parameters:
Name | Type | Description |
---|---|---|
s |
Shader | Shader to set for the Renderable. |
- Source:
Returns:
The Renderable's current Shader.
- Type
- SimpleShader
update() → {void}
Update function called on Gameloop
- Source:
Returns:
- Type
- void