shamansir / elm-aframe / AFrame.Components.Animations

Core

type_ : String -> AFrame.Properties.Property

Right now only supports color for tweening isRawProperty color XYZ/RGB vector values.

Default: ''

property : String -> AFrame.Properties.Property

Property to animate. Can be a component name, a dot-delimited property of a component (e.g., material.color), or a plain attribute.

isRawProperty : Basics.Bool -> AFrame.Properties.Property

Flag to animate an arbitrary object property outside of A-Frame components for better performance. If set to true, for example, we can set property to like components.material.material.opacity. If property starts with components or object3D, this will be inferred to true.

Default: false

Tween

from : String -> AFrame.Properties.Property

Initial value at start of animation. If not specified, the current property value of the entity will be used (will be sampled on each animation start). It is best to specify a from value when possible for stability.

fromBool : Basics.Bool -> AFrame.Properties.Property

Initial bool value at start of animation.

fromColor : Color -> AFrame.Properties.Property

Initial color at start of animation.

fromVec2 : Basics.Float -> Basics.Float -> AFrame.Properties.Property

Initial vector value at end of animation.

fromVec3 : Basics.Float -> Basics.Float -> Basics.Float -> AFrame.Properties.Property

Initial vector at start of animation.

fromValue : Basics.Float -> AFrame.Properties.Property

Initial numeric value at start of animation.

to : String -> AFrame.Properties.Property

Target value at end of animation.

toBool : Basics.Bool -> AFrame.Properties.Property

Target bool value at end of animation.

toColor : Color -> AFrame.Properties.Property

Target color value at end of animation.

toVec2 : Basics.Float -> Basics.Float -> AFrame.Properties.Property

Target vector value at end of animation.

toVec3 : Basics.Float -> Basics.Float -> Basics.Float -> AFrame.Properties.Property

Target vector value at end of animation.

toValue : Basics.Float -> AFrame.Properties.Property

Target numeric value at end of animation.

dir : AFrame.Variants.Direction.Direction -> AFrame.Properties.Property

Which dir to go from from to to.

Default: normal

Other: alternate, reverse

Easing

easing : AFrame.Variants.Easing.Easing -> AFrame.Properties.Property

Easing function of animation. To ease in, ease out, ease in and out.

elasticity : Basics.Float -> AFrame.Properties.Property

How much to bounce (higher is stronger).

Default : 400

round : Basics.Bool -> AFrame.Properties.Property

Whether to round values.

Timing

delay : Basics.Int -> AFrame.Properties.Property

How long (milliseconds) to wait before starting.

Default : 0

dur : Basics.Int -> AFrame.Properties.Property

How long (milliseconds) each cycle of the animation is.

Default : 1000

fill : AFrame.Variants.Fill.Fill -> AFrame.Properties.Property

Determines effect of animation when not actively in play. One of backwards, both, forwards, none.

Repeat

loop : Basics.Int -> AFrame.Properties.Property

How many times the animation should repeat.

Default : 0

loopForever : AFrame.Properties.Property

Events

autoplay : Basics.Bool -> AFrame.Properties.Property

Whether or not the animation should autoplay. Should be specified if the animation is defined for the animation-timeline component.

startEvents : List AFrame.EventRefs.EventRef -> AFrame.Properties.Property

Comma-separated list of events to listen to trigger a restart and play. Animation will not autoplay if specified. startEvents will restart the animation, use pauseEvents to resume it. If there are other animation components on the entity animating the same property, those animations will be automatically paused to not conflict.

pauseEvents : List AFrame.EventRefs.EventRef -> AFrame.Properties.Property

Comma-separated list of events to listen to trigger pause. Can be resumed with resumeEvents.

resumeEvents : List AFrame.EventRefs.EventRef -> AFrame.Properties.Property

Comma-separated list of events to listen to trigger resume after pausing.

Turning off

enabled : Basics.Bool -> AFrame.Properties.Property

If disabled, animation will stop and startEvents will not trigger animation start.