AbstractSpritesPrimitive
AbstractSpritesPrimitive ⇐ AbstractPrimitive
Kind: global abstract class
Extends: AbstractPrimitive
Properties
Name | Type | Description |
---|---|---|
height | number | The height of the primitive element (in pixels) |
width | number | The width of the primitive element (in pixels) |
url | String | null | A sprite sheet URL |
type | String | The type of primitive (text, rectangle, image, sprites...) |
numberOfFrames | number | The number of frames |
nbPerLine | number | The number of frames per line |
separatorSize | number | The size of the separator of sprites in the sprite sheet |
selectedColumn | number | The column of the current sprite to display |
selectedLine | number | The line of the current sprite to display |
spriteWidth | number | Width of one picture of the sprite |
spriteHeight | number | Height of one picture of the sprite |
- AbstractSpritesPrimitive ⇐
AbstractPrimitive
AbstractSpritesPrimitive()
A sprites primitive is an object that can be rendered by all kinds of renderers and it aims at displaying a sprite.
_getSpritePosition(width, height, separatorSize, column, line) ⇒ Object
Compute params to get x, y of the sprite in the sprite sheet
Kind: instance method of AbstractSpritesPrimitive
Param | Type | Description |
---|---|---|
width | number | total width of the sprite |
height | number | total height of the sprite |
separatorSize | number | size between two sprites |
column | number | selected column |
line | number | selected line |