Inheritance Sprite
View
Module hilo/view/Sprite
Requires
hilo/core/Hilo, hilo/core/Class, hilo/view/View, hilo/view/Drawable
Source
Sprite.js
Sprite animation class.
Property | Defined | |
---|---|---|
currentFrame:number
Current showing frame index, range from 0, readoly!
|
Sprite | |
interval:number
Interval between sprite animation frames.
|
Sprite | |
loop:boolean
Is sprite play in loop, default value is false.
|
Sprite | |
onEnterFrame:Function
Callback function on when sprite enter a new frame.
|
Sprite | |
paused:boolean
Is sprite paused, default value is false.
|
Sprite | |
timeBased:boolean
Is sprite animate base on time, default value is false (base on frame).
|
Sprite |
Method | Defined | |
---|---|---|
Sprite(properties)
Constructor
|
Sprite | |
addFrame(frame:Object, startIndex:Int):Sprite
Add frame into sprite.
|
Sprite | |
getFrame(indexOrName:Object):Object
Get the frame of given parameter from sprite.
|
Sprite | |
getFrameIndex(frameValue:Object):Object
Get frame index from sprite.
|
Sprite | |
getNumFrames():Uint
Return the total amount of sprite animation frames.
|
Sprite | |
goto(indexOrName:Object, pause:Boolean):Sprite
Jump to an assigned frame.
|
Sprite | |
play():Sprite
Play sprite.
|
Sprite | |
setFrame(frame:Object, index:Int):Sprite
Set the frame on the given index.
|
Sprite | |
setFrameCallback(frame:Int|String, callback:Function):Sprite
Set a callback on an assigned frame.
|
Sprite | |
stop():Sprite
Pause playing sprite.
|
Sprite |