Core. TimeLine

TimeLine Is a class used to create timeline animations.

Constructor

new TimeLine()

Extends

Member

scale :Number

Zoom animation playback speed.
Default Value:
  • 1

total :int

Get the total number of frames.

Methods

addLabel(label, offset)

Add a tag to the time queue.
Parameters:
Name Type Description
label String Tag name.
offset Number The offset time (in milliseconds) of the tag relative to the previous animation.

destroy()

Destroy this object completely.

event(type, dataopt) → {Boolean}

Dispatch events.
Inherited From:
Parameters:
Name Type Attributes Default Description
type String Event type.
data Object <optional>
null data (optional) callback data. Be careful: If you need to pass multiple parameters, P1, P2, P3, you can use the array structure, such as: [p1,p2,p3,...] If you need to call a single parameter P, and P is an array, you need to use a structure such as: [p] Other single parameters, P, can be passed directly to the parameter P.
Returns:
Type:
Boolean
Is there a listener for this event type? If there is a listener, the value is true, otherwise the value is false.

from(target, props, duration, easeopt, offsetopt)

From the props property, move to the current state.
Parameters:
Name Type Attributes Default Description
target Object Target target object (object that is about to change property values)
props Object To control the properties of an object
duration Number Time for object TWEEN
ease function <optional>
null ease Slow motion type
offset Number <optional>
0 offset How long is the offset relative to the previous object (in milliseconds)?

from(target, props, duration, easeopt, offsetopt)

From the props property, move to the current state.
Parameters:
Name Type Attributes Default Description
target Object Target target object (object that is about to change property values)
props Object To control the properties of an object
duration Number Time for object TWEEN
ease function <optional>
null ease Slow motion type
offset Number <optional>
0 offset How long is the offset relative to the previous object (in milliseconds)?

gotoLabel(Label)

Start from the specified tag.
Parameters:
Name Type Description
Label String Tag name.

gotoTime(time(单位:毫秒)。)

Animation starts at a certain time throughout the animation.
Parameters:
Name Type Description
time(单位:毫秒)。 Number

hasListener(type) → {Boolean}

inspect EventDispatcher Object registers any listeners for a particular event type.
Inherited From:
Parameters:
Name Type Description
type String Event type.
Returns:
Type:
Boolean
If the specified type of listener has been registered, the value is true; otherwise, the value is false.

isMouseEvent(type) → {Boolean}

Detects whether the specified event type is a mouse event.
Inherited From:
Parameters:
Name Type Description
type String Event type.
Returns:
Type:
Boolean
If it is a mouse event, the value is true; otherwise, the value is false.

off(type, caller, listener, onceOnly) → {EventDispatcher}

from EventDispatcher Delete listeners in object.
Inherited From:
Parameters:
Name Type Description
type String Event type.
caller Object The domain of the event listener function.
listener function Event listener function.
onceOnly Boolean (optional) if the value is true, only the listeners added by the once method are removed.
Returns:
Type:
EventDispatcher
this EventDispatcher Object.

offAll(typeopt) → {EventDispatcher}

from EventDispatcher Removes all listeners that specify the type of event in the object.
Inherited From:
Parameters:
Name Type Attributes Default Description
type String <optional>
null type (optional) event type. If the value is null, all types of listeners for this object are removed.
Returns:
Type:
EventDispatcher
this EventDispatcher Object.

on(type, caller, listener, argsopt) → {EventDispatcher}

Use EventDispatcher Object registers the event listener object of the specified type so that listeners can receive event notifications.
Inherited From:
Parameters:
Name Type Attributes Default Description
type String Event type.
caller Object The domain of the event listener function.
listener function Event listener function.
args Array <optional>
null args Optional callback parameters for the event listener function.
Returns:
Type:
EventDispatcher
this EventDispatcher Object.

once(type, caller, listener, argsopt) → {EventDispatcher}

Use EventDispatcher Object registers the event listener object of the specified type so that the listener can receive the event notification, which is automatically removed after a response event.
Inherited From:
Parameters:
Name Type Attributes Default Description
type String Event type.
caller Object The domain of the event listener function.
listener function Event listener function.
args Array <optional>
null args Optional callback parameters for the event listener function.
Returns:
Type:
EventDispatcher
this EventDispatcher Object.

pause()

Pause the entire animation.

play(timeOrLabel, loop)

Play animation.
Parameters:
Name Type Description
timeOrLabel Object Open the time point of play or the name of the tag.
loop Boolean Loop play?.

removeLabel(label)

Removes the specified tag
Parameters:
Name Type Description
label String

reset()

Reset all objects when reusing objects.

resume()

Resume playback of paused animation.

to(target, props, duration, easeopt, offsetopt)

To control an object, move from the current point to the target point.
Parameters:
Name Type Attributes Default Description
target Object Objects to control.
props Object To control the properties of an object.
duration Number Time for object TWEEN.
ease function <optional>
null ease Slow motion type
offset Number <optional>
0 offset How long is the offset relative to the previous object (in milliseconds)?.

to(target, props, duration, easeopt, offsetopt)

To control an object, move from the current point to the target point.
Parameters:
Name Type Attributes Default Description
target Object Objects to control.
props Object To control the properties of an object.
duration Number Time for object TWEEN.
ease function <optional>
null ease Slow motion type
offset Number <optional>
0 offset How long is the offset relative to the previous object (in milliseconds)?.

Event

complete

See:
  • events.Event

label

See:
  • events.Event