Package tripleplay.anim
Class AnimBuilder
java.lang.Object
tripleplay.anim.AnimBuilder
Provides a fluent interface for building single chains of animations. See
Animator
for a
concrete entry point.-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionCreates an animation that executes the supplied runnable and immediately completes.add
(GroupLayer parent, Layer child) Adds the supplied child to the supplied parent.abstract <T extends Animation>
Tadd
(T anim) Registers an animation with this builder.addAt
(GroupLayer parent, Layer child, float x, float y) Adds the supplied child to the supplied parent at the specified translation.addAt
(GroupLayer parent, Layer child, pythagoras.f.XY pos) Adds the supplied child to the supplied parent at the specified translation.delay
(float duration) Creates an animation that delays for the specified duration in milliseconds.dispose
(react.Closeable dable) Disposes the specified disposable.<T> Animation.Action
emit
(react.Signal<T> signal, T value) Emitsvalue
onsignal
.flipbook
(GroupLayer box, Flipbook book) Starts a flipbook animation in a new image layer which is created and added tobox
.flipbook
(ImageLayer layer, Flipbook book) Starts a flipbook animation that displays inlayer
.flipbookAt
(GroupLayer parent, float x, float y, Flipbook book) Starts a flipbook animation that displays the suppliedbook
at the specified position in the supplied parent.flipbookAt
(GroupLayer parent, pythagoras.f.XY pos, Flipbook book) Starts a flipbook animation that displays the suppliedbook
at the specified position in the supplied parent.Increments (or decrements ifamount
is negative} an int value.Plays the supplied sound.Plays the supplied clip or loop.reparent
(GroupLayer newParent, Layer child) Reparents the supplied child to the supplied new parent.Returns a builder which can be used to construct an animation that will be repeated until the supplied layer has been removed from its parent.Sets the specified layer's depth to the specified value.<T> Animation.Action
setValue
(react.Value<T> value, T newValue) Sets a value to the supplied constant.setVisible
(Layer layer, boolean visible) Sets the specified layer to visible or not.Creates a shake animation on the specified layer.Stops the supplied sound from playing.Stops the supplied clip or loop.tween
(Animation.Value value) Starts a tween using the supplied custom value.tween
(Animation.XYValue value) Starts a tween using the supplied custom X/Y value.tweenAlpha
(Layer layer) Starts a tween on the supplied layer's transparency.tweenOrigin
(Layer layer) Starts a tween on the supplied layer's origin.tweenRotation
(Layer layer) Starts a tween on the supplied layer's rotation.tweenScale
(Layer layer) Starts a tween on the supplied layer's x/y-scale.tweenScaleX
(Layer layer) Starts a tween on the supplied layer's x-scale.tweenScaleXY
(Layer layer) Starts a tween on the supplied layer's x/y-scale.tweenScaleY
(Layer layer) Starts a tween on the supplied layer's y-scale.tweenTranslation
(Layer layer) Starts a tween on the supplied layer's x/y-translation.tweenVolume
(Sound sound) Tweens the volume of the supplied sound.tweenVolume
(Playable sound) Tweens the volume of the supplied playable.Starts a tween on the supplied layer's x-translation.Starts a tween on the supplied layer's x/y-translation.Starts a tween on the supplied layer's y-translation.
-
Constructor Details
-
AnimBuilder
public AnimBuilder()
-
-
Method Details
-
add
Registers an animation with this builder. If this is the root animator, it will be started on the next frame and continue until cancelled or it reports that it has completed. If this is an animator returned fromAnimation.then()
then the queued animation will be started when the animation on whichthen
was called has completed. -
tweenTranslation
Starts a tween on the supplied layer's x/y-translation. -
tweenXY
Starts a tween on the supplied layer's x/y-translation. -
tweenX
Starts a tween on the supplied layer's x-translation. -
tweenY
Starts a tween on the supplied layer's y-translation. -
tweenOrigin
Starts a tween on the supplied layer's origin. -
tweenRotation
Starts a tween on the supplied layer's rotation. -
tweenScale
Starts a tween on the supplied layer's x/y-scale. -
tweenScaleXY
Starts a tween on the supplied layer's x/y-scale. -
tweenScaleX
Starts a tween on the supplied layer's x-scale. -
tweenScaleY
Starts a tween on the supplied layer's y-scale. -
tweenAlpha
Starts a tween on the supplied layer's transparency. -
tween
Starts a tween using the supplied custom value.Animation.Value.initial()
will be used (if needed) to obtain the initial value before the tween begins.Animation.Value.set(float)
will be called each time the tween is updated with the intermediate values. -
tween
Starts a tween using the supplied custom X/Y value. -
flipbook
Starts a flipbook animation that displays inlayer
. Note that the image layer in question will have its translation adjusted based on the offset of the current frame. Thus it should be placed into aGroupLayer
if it is to be positioned and animated separately. -
flipbook
Starts a flipbook animation in a new image layer which is created and added tobox
. When the flipbook animation is complete, the newly created image layer will not be disposed automatically. This allows the animation to be repeated, if desired. The caller must dispose eventually the image layer, or more likely, disposebox
which will cause the created image layer to be disposed. -
flipbookAt
Starts a flipbook animation that displays the suppliedbook
at the specified position in the supplied parent. The intermediate layers created to display the flipbook animation will be disposed on completion. -
flipbookAt
Starts a flipbook animation that displays the suppliedbook
at the specified position in the supplied parent. The intermediate layers created to display the flipbook animation will be disposed on completion. -
shake
Creates a shake animation on the specified layer. -
delay
Creates an animation that delays for the specified duration in milliseconds. -
repeat
Returns a builder which can be used to construct an animation that will be repeated until the supplied layer has been removed from its parent. The layer must be added to a parent before the next frame (if it's not already), or the cancellation will trigger immediately. -
action
Creates an animation that executes the supplied runnable and immediately completes. -
add
Adds the supplied child to the supplied parent. This is generally done as the beginning of a chain of animations, which itself may be delayed or subject to animation barriers. -
addAt
Adds the supplied child to the supplied parent at the specified translation. This is generally done as the beginning of a chain of animations, which itself may be delayed or subject to animation barriers. -
addAt
Adds the supplied child to the supplied parent at the specified translation. This is generally done as the beginning of a chain of animations, which itself may be delayed or subject to animation barriers. -
reparent
Reparents the supplied child to the supplied new parent. This involves translating the child's current coordinates to screen coordinates, moving it to its new parent layer and translating its coordinates into the coordinate space of the new parent. Thus the child does not change screen position, even though its coordinates relative to its parent will most likely have changed. -
dispose
Disposes the specified disposable. -
setDepth
Sets the specified layer's depth to the specified value. -
setVisible
Sets the specified layer to visible or not. -
play
Plays the supplied clip or loop. -
stop
Stops the supplied clip or loop. -
play
Plays the supplied sound. -
tweenVolume
Tweens the volume of the supplied playable. Note, this does not play or stop the sound, those must be enacted separately. -
tweenVolume
Tweens the volume of the supplied sound. Useful for fade-ins and fade-outs. Note, this does not play or stop the sound, those must be enacted separately. -
stop
Stops the supplied sound from playing. -
emit
Emitsvalue
onsignal
. -
setValue
Sets a value to the supplied constant. -
increment
Increments (or decrements ifamount
is negative} an int value.
-