类: Tween

Tween

Tween class


构造

new Tween()

成员

名称 说明
animationId

Property = animationId {int} Loop id returned by Animation.start

begin

APIProperty = begin {Object} Values to start the animation with

callbacks

APIProperty = callbacks {Object} An object with start, eachStep and done properties whose values are functions to be call during the animation. They are passed the current computed value as argument.

duration

APIProperty = duration {int} duration of the tween (number of steps)

easing

APIProperty: easing {(Function)} TweenEasing equation used for the animation Defaultly set to TweenEasing.Expo.easeOut

finish

APIProperty = finish {Object} Values to finish the animation with

minFrameRate

APIProperty = minFrameRate {Number} The minimum framerate for animations in frames per second. After each step, the time spent in the animation is compared to the calculated time at this frame rate. If the animation runs longer than the calculated time, the next step is skipped. Default is 30.

playing

Property = playing {Boolean} Tells if the easing is currently playing

startTime

Property = startTime {Number} The timestamp of the first execution step. Used for skipping frames

time

Property = time {int} Step counter

方法列表

名称 说明
play()

Method: play Calls the appropriate easing method

start()

APIMethod: start Plays the Tween, and calls the callback method on each step

Parameters: begin - {Object} values to start the animation with finish - {Object} values to finish the animation with duration - {int} duration of the tween (number of steps) options - {Object} hash of options (callbacks (start, eachStep, done), minFrameRate)

stop()

APIMethod: stop Stops the Tween, and calls the done callback Doesn't do anything if animation is already finished

详细说明


play()

Method: play Calls the appropriate easing method


start()

APIMethod: start Plays the Tween, and calls the callback method on each step

Parameters: begin - {Object} values to start the animation with finish - {Object} values to finish the animation with duration - {int} duration of the tween (number of steps) options - {Object} hash of options (callbacks (start, eachStep, done), minFrameRate)


stop()

APIMethod: stop Stops the Tween, and calls the done callback Doesn't do anything if animation is already finished