Fx

Functions in fx.


Move To

move_to(
    pos: Vec2,
    dur: float = 0.0,
    ease: Callable[[float], float] | None = None
) Effect

Create a move-to effect.

Args

  • pos : Target position.
  • dur : Duration in seconds.
  • ease : Easing function (t -> t).

Returns

Effect : The move-to effect.

Scale To

scale_to(
    scale: object | None = None,
    dur: float = 0.0,
    ease: Callable[[float], float] | None = None
) Effect

Create a scale-to effect.

Args

  • 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.

Rotate To

rotate_to(
    angle: float,
    clockwise: bool = True,
    dur: float = 0.0,
    ease: Callable[[float], float] | None = None
) Effect

Create a rotate-to effect.

Args

  • angle : Target angle in radians.
  • clockwise : Direction of rotation. True for clockwise, False for counterclockwise.
  • 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 = None
) Effect

Create a rotate-by effect.

Args

  • delta : Delta angle in radians to rotate by in radians.
  • clockwise : Direction of rotation. True for clockwise, False for counterclockwise.
  • dur : Duration in seconds.
  • ease : Easing function (t -> t).

Returns

Effect : The rotate-by effect.

Shake

shake(amp: float, freq: float, dur: float) Effect

Create a shake effect.

Args

  • amp : Shake amplitude in pixels.
  • freq : Shake frequency in Hz.
  • dur : Duration in seconds.

Returns

Effect : The shake effect.

Call

call(callback: Callable[[], None]) Effect

Create an effect that calls a function.

Args

  • callback : Function to call when this step is reached.

Returns

Effect : The call effect.

Wait

wait(dur: float) Effect

Create a wait/delay effect.

Args

  • dur : Duration to wait in seconds.

Returns

Effect : The wait effect.