MODULE v1.8.0

fx

pykraken.fx

Predefined effects for use with the Orchestrator.

Reference

PYTHON API

call

function
call(callback: Callable[[], None]) -> fx.Effect

Create an effect that calls a function.

Args

  • callback (callable) — Function to call when this step is reached.

Returns

  • Effect — The call effect.

move_to

function
move_to(pos: Vec2, dur: float = 0.0, ease: Callable[[float], float] | None = None) -> fx.Effect

Create a move-to effect.

Args

  • pos (Vec2) — Target position.
  • dur (float) — Duration in seconds.
  • ease (callable) — Easing function (t -> t).

Returns

  • Effect — The move-to effect.

rotate_by

function
rotate_by(delta: float, clockwise: bool = True, dur: float = 0.0, ease: Callable[[float], float] | None = None) -> fx.Effect

Create a rotate-by effect.

Args

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

Returns

  • Effect — The rotate-by effect.

rotate_to

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

Create a rotate-to effect.

Args

  • angle (float) — Target angle in radians.
  • clockwise (bool) — Direction of rotation. True for clockwise, False for counterclockwise.
  • dur (float) — Duration in seconds.
  • ease (callable) — Easing function (t -> t).

Returns

  • Effect — The rotate-to effect.

scale_by

function
scale_by(scale: float, dur: float = 0.0, ease: Callable[[float], float] | None = None) -> fx.Effect

Create a scale-by effect.

Args

  • scale (float) — Delta scalar to apply to the scale.
  • dur (float) — Duration in seconds.
  • ease (callable) — Easing function (t -> t).

Returns

  • Effect — The scale-by effect.

scale_to

function
scale_to(scale: Vec2, dur: float = 0.0, ease: Callable[[float], float] | None = None) -> fx.Effect

Create a scale-to effect.

Args

  • scale (Vec2) — Target scale exact dimensions.
  • dur (float) — Duration in seconds.
  • ease (callable) — Easing function (t -> t).

Returns

  • Effect — The scale-to effect.

shake

function
shake(amp: float, freq: float, dur: float) -> fx.Effect

Create a shake effect.

Args

  • amp (float) — Shake amplitude in pixels.
  • freq (float) — Shake frequency in Hz.
  • dur (float) — Duration in seconds.

Returns

  • Effect — The shake effect.

wait

function
wait(dur: float) -> fx.Effect

Create a wait/delay effect.

Args

  • dur (float) — Duration to wait in seconds.

Returns

  • Effect — The wait effect.

Find your next step

Start typing to search the manual.