rekapi

rekapi

Source:

Classes

Actor
CanvasRenderer
DOMRenderer
KeyframeProperty
Rekapi

Type Definitions

actorData

Properties:
Name Type Description
trackNames Array.<string>

The values of this array must correspond 1:1 to the key names in propertyTracks.

propertyTracks Object.<Array.<rekapi.propertyData>>
end number
start number
id string | undefined
Source:
Type:
  • Object

actorSortFunction(actor) → {number}

Source:
Parameters:
Name Type Description
actor rekapi.Actor

A rekapi.Actor that should expose a number value to sort by.

Returns:
Type:
number

curveData

The properties of this object are used as arguments provided to shifty.setBezierFunction.

Properties:
Name Type Description
x1 number
x2 number
y1 number
y2 number
displayName string
Source:
Type:
  • Object

easingOption

Either the name of an easing curve or an array of four numbers ([x1, y1, x2, y2]) that represent the points of a Bezier curve.

Source:
See:
Type:
  • string | Array.<number>

eventHandler(rekapi, data)

A function that is called when an event is fired. See the events listed below for details on the types of events that Rekapi supports.

Source:
Parameters:
Name Type Description
rekapi rekapi.Rekapi

A rekapi.Rekapi instance.

data Object

Data provided from the event (see rekapi.Rekapi#on for details).

keyframeFunction(actor, drift)

Source:
Parameters:
Name Type Description
actor rekapi.Actor

The rekapi.Actor to which this rekapi.keyframeFunction was provided.

drift number

A number that represents the delay between when the function is called and when it was scheduled. There is typically some amount of delay due to the nature of JavaScript timers.

propertyData

Properties:
Name Type Description
value number | string
millisecond number
easing string
name string
id string | undefined
Source:
Type:
  • Object

render(context, state)

A function that gets called every time the actor's state is updated (once every frame). This function should do something meaningful with the state of the actor (for example, visually rendering to the screen).

Source:
Parameters:
Name Type Description
context Object

An actor's rekapi.Actor#context Object.

state Object

An actor's current state properties.

renderer

An Object that provides utilities for rendering a rekapi.Actor.

Properties:
Name Type Description
render rekapi.render

A function that renders a rekapi.Actor.

Source:
Type:
  • Object

timelineData

The JSON.stringify-friendly data format for serializing a Rekapi animation.

Properties:
Name Type Description
actors Array.<rekapi.actorData>
curves Object.<rekapi.curveData>
duration number
Source:
Type:
  • Object

Events

addActor

Source:
Parameters:
Name Type Description
actor rekapi.Actor

The rekapi.Actor that was added.

addKeyframeProperty

Source:
Parameters:
Name Type Description
keyframeProperty rekapi.KeyframeProperty

The rekapi.KeyframeProperty that was added.

addKeyframePropertyTrack

Fires when the a keyframe is added to an actor that creates a new keyframe property track.

Source:
Parameters:
Name Type Description
keyframeProperty rekapi.KeyframeProperty

The rekapi.KeyframeProperty that was added to create the property track.

afterUpdate

Fires each frame after all actors are rendered.

Source:

animationComplete

Fires when all animation loops have completed.

Source:

animationLooped

Fires when an animation loop ends and a new one begins.

Source:

beforeAddKeyframeProperty

Fires just before the point where a rekapi.KeyframeProperty is added to the timeline. This event is called before any modifications to the timeline are done.

Source:

beforeRemoveKeyframeProperty

Fires just before the point where a rekapi.KeyframeProperty is removed. This event is called before any modifications to the timeline are done.

Source:

beforeUpdate

Fires each frame before all actors are rendered.

Source:

pause

Fires when the animation is rekapi.Rekapi#paused.

Source:

play

Fires when the animation is rekapi.Rekapi#played.

Source:

playStateChange

Fires when the animation is played, paused, or stopped.

Source:

removeActor

Source:
Parameters:
Name Type Description
actor rekapi.Actor

The rekapi.Actor that was removed.

removeKeyframeProperty

Fires when a rekapi.KeyframeProperty is removed. This event is fired before the internal state of the keyframe (but not the timeline, in contrast to rekapi.event:beforeRemoveKeyframeProperty) has been updated to reflect the keyframe property removal (this is in contrast to rekapi.event:removeKeyframePropertyComplete).

Source:
Parameters:
Name Type Description
keyframeProperty rekapi.KeyframeProperty

The rekapi.KeyframeProperty that was removed.

removeKeyframePropertyComplete

Fires when a rekapi.KeyframeProperty has finished being removed from the timeline. Unlike rekapi.event:removeKeyframeProperty, this is fired after the internal state of Rekapi has been updated to reflect the removal of the keyframe property.

Source:
Parameters:
Name Type Description
keyframeProperty rekapi.KeyframeProperty

The rekapi.KeyframeProperty that was removed.

removeKeyframePropertyTrack

Fires when the last keyframe property in an actor's keyframe property track is removed. Rekapi automatically removes property tracks when they are emptied out, which causes this event to be fired.

Source:
Parameters:
Name Type Description
trackName string

name of the track that was removed.

stop

Fires when the animation is rekapi.Rekapi#stopped.

Source:

timelineModified

Fires when a keyframe is added, modified or removed.

Source: