The Juggler controls the progress of your application by propagating the time passed between two render frames.

The RenderLoop and Stage class provide juggler instances which are driven by the browsers animation frames. You can also create your own Juggler instance and control the time by yourself. Because Juggler implements the Animatable interface it can be added to other Juggler instances too.

See also: Tween, Transition, DelayedCall

Examples:

var tween = new Tween(sprite, 1.0, Transition.easeIn);
tween.animate.x.to(1.0);
stage.juggler.add(tween);

// create a "gameJuggler" who controls all my animations.
var gameJuggler = new Juggler();
// start all animations controlled by "gameJuggler".
stage.juggler.add(gameJuggler);
// stop all animations controlled by "gameJuggler".
stage.juggler.remove(gameJuggler);
Implements
  • Animatable

Constructors

Juggler()

Properties

elapsedTime → num

The elapsed time since the juggler has started.

read-only
hasAnimatables → bool

Check whether this Juggler has active animatables or not.

read-only
hashCode → int

Get a hash code for this object.

read-only, inherited
onElapsedTimeChange → Stream<num>

A stream of elapsedTime changes.

read-only
runtimeType → Type

A representation of the runtime type of the object.

read-only, inherited

Operators

operator ==(other) → bool

The equality operator.

inherited

Methods

add(Animatable animatable) → void

Adds the animatable to this juggler who will take care that it is animated.

addChain(List<Animatable> animatables) AnimationChain

This is a convenience method that creates an AnimatableChain and adds it to this juggler. See AnimatableChain for more details.

addGroup(List<Animatable> animatables) AnimationGroup

This is a convenience method that creates an AnimatableGroup and adds it to this juggler. See AnimatableGroup for more details.

addTranslation(num startValue, num targetValue, num time, TransitionFunction transition, void onUpdate(num value)) Translation

This is a convenience method that creates a Translation and adds it to this juggler. See Translation for more details.

addTween(TweenObject tweenObject, num time, [ TransitionFunction transition = Transition.linear ]) Tween

This is a convenience method that creates a Tween and adds it to this juggler. See Tween for more details.

advanceTime(num time) → bool

This method is called by the Juggler with the time past since the last call.

clear() → void

Removes all Animatables from this juggler.

contains(Animatable animatable) → bool

Returns true if this juggler contains the specified animatable.

containsTweens(TweenObject tweenObject) → bool

Returns true if this juggler contains tweens for the specified tweenObject.

delay(num time) → Future

Returns a Future which completes after time seconds.

delayCall(Function action, num delay) DelayedCall

This is a convenience method that creates a DelayedCall and adds it to this juggler. See DelayedCall for more details.

interval(num time) → Stream<int>

Returns a Stream of counter values which fires every time seconds.

noSuchMethod(Invocation invocation) → dynamic

Invoked when a non-existent method or property is accessed.

inherited
remove(Animatable animatable) → void

Removes the specified animatable from this juggler.

removeTweens(TweenObject tweenObject) → void

Removes all tweens from the specified tweenObject.

timespan(num time) → Stream<num>

Returns a Stream of relative time which fires for time seconds.

toString() → String

Returns a string representation of this object.

inherited
translation(num startValue, num targetValue, num time, [ TransitionFunction transition = Transition.linear ]) → Stream<num>

Returns a Stream of translated values which fires for time seconds.