FX
Effect functions for use with the Orchestrator class.
Note:
The fx module must be explicitly imported. It is used with the Orchestrator class to create timeline-based animations.
Wait
wait(dur: float) → EffectCreate a wait/delay effect.
Parameters
dur: Duration to wait in seconds.
Returns
Effect : The wait effect.
Call
call(callback: Callable[[], None]) → EffectCreate an effect that calls a function.
Parameters
callback: Function to call when this step is reached.
Returns
Effect : The call effect.
Move To
move_to(
pos: Vec2 = None,
dur: float = 0.0,
ease: Callable[[float], float] = None
) → EffectCreate a move-to effect.
Parameters
pos: Target position.dur: Duration in seconds.ease: Easing function (t → t).
Returns
Effect : The move-to effect.
Rotate To
rotate_to(
angle: float,
clockwise: bool = True,
dur: float = 0.0,
ease: Callable[[float], float] = None
) → EffectCreate a rotate-to effect.
Parameters
angle: Target angle in radians.clockwise: Direction of rotation.dur: Duration in seconds.ease: Easing function (t → t).
Returns
Effect : The rotate-to effect.
Rotate By
rotate_by(
delta: float,
clockwise: bool = True,
dur: float = 0.0,
ease: Callable[[float], float] = None
) → EffectCreate a rotate-by effect.
Parameters
delta: Delta angle in radians to rotate by.clockwise: Direction of rotation.dur: Duration in seconds.ease: Easing function (t → t).
Returns
Effect : The rotate-by effect.
Scale To
scale_to(
scale: float | Vec2 = None,
dur: float = 0.0,
ease: Callable[[float], float] = None
) → EffectCreate a scale-to effect.
Parameters
scale: Target scale. A single number applies to both axes.dur: Duration in seconds.ease: Easing function (t → t).
Returns
Effect : The scale-to effect.
Shake
shake(amp: float, freq: float, dur: float) → EffectCreate a shake effect.
Parameters
amp: Shake amplitude in pixels.freq: Shake frequency in Hz.dur: Duration in seconds.
Returns
Effect : The shake effect.