Sprite

An sprite using a loaded srpite texture created by add.sprite

virtuosity.engine2d.Sprite

Components


pixi

reference to the render object



Parameter Type Description
pixi Pixi.js object reference to the pixi render object (internal)
type String the type of the Entity

id

reference to id of the render object.



Parameter Type Description
id String reference to id of the render object

position

position of the render object



Parameter Type Description
x Number x coordinate of the render object
y Number y coordinate of the render object

rotation

rotation of the render object

Parameter Type Description Default
rotation Number rotation of the render object 0

anchor

the position and rotation point of the render object

Parameter Type Description Default
x Number x coordinate of the anchor point 0
y Number y coordinate of the anchor point 0

alpha

alpha of the render object

Parameter Type Description Default
alpha Number alpha of the render object 1

scale

the scale of the render object



Parameter Type Description
width Number width of the render object
height Number height of the render object

tint

tint of the render object

Parameter Type Description Default
tint Hex tint of the render object 0xffffff

zIndex

zIndex of the render object

Parameter Type Description Default
zIndex Number zIndex of the render object 0

sprite

frame management of a sprite



Parameter Type Description
frame Number frame the sprite is using
totalFrames Number totalFrames the sprite has
addAnimation Function add an animation (name, frames, frameTime)
deleteAnimation Function delete an animation (name)
getAnimation Function get an animation (name)