Keyframes

Keyframes

a list of objects in chronological order.

Constructor

new Keyframes()

Source:

Methods

add(time, object) → {Keyframes}

Source:
add object in list
Name Type Description
time number frame's time
object any target
Returns:
An instance itself
Type
Keyframes

forEach(callback) → {Keyframes}

Source:
executes a provided function once for each scene item.
Name Type Description
callback (item: any, time: number, items: ObjectInterface<any>) => void Function to execute for each element, taking three arguments
Returns:
An instance itself
Type
Keyframes

get(time) → {object}

Source:
get object at that time.
Name Type Description
time number object's time
Returns:
object at that time
Type
object

getDuration() → {number}

Source:
Get how long an animation should take to complete one cycle.
Returns:
duration
Type
number

getNames() → {string[][]}

Source:
A list of names
Example
keyframes.getNames(); // [["a"], ["transform", "translate"], ["transform", "scale"]]
Returns:
names
Type
string[][]

has(time) → {boolean}

Source:
Check if keyframes has object at that time.
Name Type Description
time number object's time
Returns:
true: if has time, false: not
Type
boolean

hasName(...args) → {boolean}

Source:
Check if keyframes has propery's name
Name Type Description
...args string[] property's time
Example
keyframes.hasName("transform", "translate"); // true or not
Returns:
true: if has property, false: not
Type
boolean

remove(time) → {Keyframes}

Source:
remove object at that time.
Name Type Description
time number object's time
Returns:
An instance itself
Type
Keyframes

setDuration(duration, originalDurationopt) → {Keyframes}

Source:
Set how long an animation should take to complete one cycle.
Name Type Default Description
duration number duration
originalDuration? number this.getDuration()
Returns:
An instance itself.
Type
Keyframes

size() → {Number}

Source:
get size of list
Returns:
length of list
Type
Number

unshift(time) → {Keyframes}

Source:
Set how much time you want to push ahead.
Name Type Description
time number time
Returns:
An instance itself.
Type
Keyframes

update() → {Keyframes}

Source:
update property names used in frames.
Returns:
An instance itself
Type
Keyframes

updateFrame(frameopt) → {Keyframes}

Source:
update property names used in frame.
Name Type Description
frame? Frame frame of that time.
Example
keyframes.updateFrame(frame);
Returns:
An instance itself
Type
Keyframes