Wikitude ARchitect v2.0 API Documentation

Wikitude ARchitect > AR > AnimationGroup
Filters

Class AnimationGroup - extends Animation

An AnimationGroup allows to run a group of Animations sequentially or in parallel.

An AnimationGroup consists of an array of Animations that form the AnimationGroup. A parallel AnimationGroup runs all contained Animations in parallel, starting at the same time. A sequential AnimationGroup runs all contained Animations sequentially, starting with the first Animation in the array. The length of the AnimationGroup will be defined as
  • the maximum length of the contained Animations in case of a parallel AnimationGroup
  • the sum of all lengths of the contained Animations in case of a sequential AnimationGroup


Example:
//We want to animate two GeoLocations to move 100 meters up in altitude at the same time
// over a period of 10 seconds to simulate an elevator
var elevatorAnimation1 = 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)
  {type: AR.CONST.EASING_CURVE_TYPE.EASE_IN_OUT_QUAD}, //easing curve to simulate acceleration and deceleration
);
var elevatorAnimation2 = new AR.PropertyAnimation(
  geoLocation2, //the object geoLocation2 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)
  {type: AR.CONST.EASING_CURVE_TYPE.EASE_IN_OUT_QUAD}, //easing curve to simulate acceleration and deceleration
);
var animationGroup = new AR.AnimationGroup(
  AR.CONST.ANIMATION_GROUP_TYPE.PARALLEL, // the animations will run in parallel
  [elevatorAnimation1, elevatorAnimation2], // the animations in the AnimationGroup
  {onFinish : beepSound.play} //when finished, play a beep sound that elevators have reached their positions
);
// now, start the animation group
animationGroup.start();

Constructor

AnimationGroup ( type , animations , options )
Parameters:
type <string> The type of AnimationGroup. Must either be "parallel" or "sequential". Use of the values defined in AR.CONST.ANIMATION_GROUP_TYPE is suggested.
animations <Array(Animation)> The array of animations.
options <object> Setup-Parameters to customize additional object properties.

Accepted options-properties are
  • onStart
  • onFinish

Properties inherited from ARchitectObject:

Methods inherited from ARchitectObject:

Methods inherited from Animation:


Copyright © 2013 Wikitude GmbH. All rights reserved.