Wikitude SDK API Reference

API Docs for: 8.2.0
Show:

PropertyAnimation Class

Extends Animation
Module: AR

Property Animations allow constant changes to a numeric value/property of an object, dependent on start-value, end-value and the duration of the animation.
Animations can be seen as functions defining the progress of the change on the value. The Animation can be parametrized via easing curves.

Example:
//We want to animate a GeoLocation to move 100 meters up in altitude
// over a period of 10 seconds to simulate an elevator
var elevatorAnimation = new AR.PropertyAnimation(
  geoLocation1, //the object geoLocation1 holds the animated property
  "altitude", //the property altitude will be animated
  500, //the start value of the animation is 500 meters
  600, //the resulting value of the animation is 600 meters
  10000, //the duration of the elevator climb is 10 seconds (10000 miliseconds)
  easingCurve, //easing curve object to simulate acceleration and deceleration
  {onFinish : beepSound.play} //when finished, play a beep sound that elevator doors will now open
);

Constructor

PropertyAnimation

(
  • target
  • property
  • start
  • end
  • duration
  • easingCurve
  • options
)

Parameters:

  • target ARchitectObject

    The object which holds the property that will be animated. Must be an AR.ARchitectObject.

  • property String

    The object's property name that will be animated.

  • start Number

    The value the PropertyAnimation will start with. If null, the current value of the property will be used. Remark: In case null is set as start value, and the PropertyAnimation loops more than once, the PropertyAnimation will not reset the value after it has completed the first run, and the value won't change in the following runs. To reset the value after each run, supply the property's current value as start value.

  • end Number

    The value the PropertyAnimation will end with. The value must be non-null.

  • duration Number

    The duration of the PropertyAnimation, in milliseconds. The value must be non-negative and a whole number.

  • easingCurve (defaults to AR.EasingCurve("linear")) EasingCurve optional

    an AR.EasingCurve describing the nature of the animation. If the easingCurve parameter is omitted, set to null or undefined or does not contain a type property, the easingCurve parameter will default to a linear easing curve.

  • options Object

    Setup-Parameters to customize additional object properties.

    Accepted options-properties are

Item Index

Properties

Events

Methods

destroy

()

Inherited from ARchitectObject

Destroys the object.

isRunning

() Boolean

Inherited from Animation

Checks if the Animation is currently running.

Returns:

Boolean:

true if the Animation is currently running, false if the Animation is currently not running.

pause

()

Inherited from Animation

Pauses the Animation.
If the PropertyAnimation is currently not running, the call will have no effect.

resume

()

Inherited from Animation

Resumes the Animation.
If the PropertyAnimation is currently running, the call has no effect. Otherwise, it will either be resumed from the position where it was last paused, or will start from the beginning if it was not paused.

start

(
  • loopTimes
)

Inherited from Animation

Immediately starts the Animation.

Parameters:

  • loopTimes (defaults to 1) Number optional

    Defines how often the animation should be played. A negative value indicates an infinite looping. Must be a whole number.

stop

()

Inherited from Animation

Immediately stops the Animation. Allows manual stopping of the Animation before the animation would automatically stop. The onFinish-trigger will not be fired after a manual stopping.

Properties

destroyed

Boolean

Inherited from ARchitectObject

Indicates if the object has already been destroyed.

Events

onFinish

Inherited from Animation

The trigger will fire when the Animation finishes.

The trigger is null by default, and will thus result in no action executed when the trigger fires. A developer can add custom functionality by assigning a custom function to onFinish.

onStart

Inherited from Animation

The trigger will fire right before the Animation starts.

The trigger is null by default, and will thus result in no action executed when the trigger fires. A developer can add custom functionality by assigning a custom function to onStart.