new SpriteRenderable(myTexture) → {SpriteRenderable}
Constructor of SpriteRenderable object.
Parameters:
Name | Type | Description |
---|---|---|
myTexture |
Texture | Texture to be associated by object. |
- Source:
Returns:
Instance of this SpriteRenderable object
- Type
- SpriteRenderable
Members
(static) eTexCoordArray :Array.<float>|enum
the expected texture cooridnate array is an array of 8 floats where elements:
[0] [1]: is u/v coordinate of Top-Right
[2] [3]: is u/v coordinate of Top-Left
[4] [5]: is u/v coordinate of Bottom-Right
[6] [7]: is u/v coordinate of Bottom-Left
Type:
- Array.<float> | enum
- Source:
Methods
_setTexInfo() → {void}
implements the _setTexInfo() function to support per-pixel collision for sprite elements
Returns:
- Type
- void
draw(aCamera) → {void}
Draws the SpriteRenderable to the screen in the aCamera viewport.
Parameters:
Name | Type | Description |
---|---|---|
aCamera |
Camera | drawing Camera of the SpriteRenderable. |
- Source:
Returns:
- Type
- void
getElementUVCoordinateArray() → {Array.<float>}
Returns a UV Coordinate Array.
- Source:
Returns:
UV Voordinate Array
- Type
- Array.<float>
setElementPixelPositions(left, right, bottom, top) → {void}
specify element region by pixel positions (between 0 to image resolutions)
Parameters:
Name | Type | Description |
---|---|---|
left |
float | Sets the Left pixel position. |
right |
float | Sets the Right pixel position. |
bottom |
float | Sets the Bottom pixel position. |
top |
float | Sets the Top pixel position. |
- Source:
Returns:
- Type
- void
setElementUVCoordinate(left, right, bottom, top) → {void}
specify element region by texture coordinate (between 0 to 1)
Parameters:
Name | Type | Description |
---|---|---|
left |
float | Sets the Left UV Coordinate. |
right |
float | Sets the Right UV Coordinate. |
bottom |
float | Sets the Bottom UV Coordinate. |
top |
float | Sets the Top UV Coordinate. |
- Source:
Returns:
- Type
- void