final class UIAnimation
package smidr
A preset transform animation on any DisplayObject, driven by one pooled UITween over a
0..1 progress and applied through a center-pivoted matrix (so scale/rotate presets pivot on
the object's centre, not its top-left origin). Entrance presets settle the target back to its
captured resting transform; exit presets leave it hidden.
UIAnimation.play(panel, POP);
UIAnimation.play(toast, FLY_IN, {edge: TOP});
UIAnimation.play(dialog, FADE_OUT, {onDone: dialog.dispose});
The resting transform (position, alpha) is captured at play, and the object's size is read
then to find its centre — so start from a settled scale (1) and layout for the pivot to be
right. FLIP is a 2D scale fake (OpenFL core has no 3D rotation).
Static methods
staticplay(target:DisplayObject, preset:UIAnimationPreset, ?opts:Null<UIAnimOptions>):UIAnimation
Plays a preset animation on a display object.
Parameters:
target | the object to animate |
|---|---|
preset | the animation preset |
opts | optional duration/ease/edge/distance/onDone overrides |
Returns:
the running animation (hold it only if you may stop())
Methods
stop(complete:Bool = false):Void
Stops the animation early.
Parameters:
complete |
|
|---|