AbstractSpritesPrimitive

AbstractSpritesPrimitive ⇐ AbstractPrimitive

Kind: global abstract class
Extends: AbstractPrimitive
Properties

NameTypeDescription
heightnumber

The height of the primitive element (in pixels)

widthnumber

The width of the primitive element (in pixels)

urlString | null

A sprite sheet URL

typeString

The type of primitive (text, rectangle, image, sprites...)

numberOfFramesnumber

The number of frames

nbPerLinenumber

The number of frames per line

separatorSizenumber

The size of the separator of sprites in the sprite sheet

selectedColumnnumber

The column of the current sprite to display

selectedLinenumber

The line of the current sprite to display

spriteWidthnumber

Width of one picture of the sprite

spriteHeightnumber

Height of one picture of the sprite

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

ParamTypeDescription
widthnumber

total width of the sprite

heightnumber

total height of the sprite

separatorSizenumber

size between two sprites

columnnumber

selected column

linenumber

selected line