Orchestrator
pykraken.Orchestrator Timeline animator for Transform objects.
More about Orchestrator
Allows chaining effects to create complex animations that play over time. Effects can run sequentially or in parallel.
Attributes
- finalized (
bool) — Whether the orchestrator has been finalized. - playing (
bool) — Whether the animation is currently playing. - finished (
bool) — Whether the animation has completed. - looping (
bool) — Whether the animation should loop when finished.
Methods
parallel(*effects): Add multiple effects to run in parallel. then(effect): Add a single effect to the timeline. finalize(): Finalize the orchestrator, preventing further edits. play(): Start playing the animation from the beginning. pause(): Pause the animation at the current position. resume(): Resume a paused animation. stop(): Stop the animation and reset to the beginning. rewind(): Reset the animation to the beginning without stopping.
At a glance
13 membersReference
PYTHON APIConstructor
methodOrchestrator(target: Transform)Create an Orchestrator for animating transforms.
Args
- target (
Transform) — The transform to animate.
finalized
propertyfinalized: boolWhether the orchestrator has been finalized.
finished
propertyfinished: boolWhether the animation has completed.
looping
propertylooping: boolWhether the animation should loop when finished.
playing
propertyplaying: boolWhether the animation is currently playing.
finalize
methodfinalize(self) -> NoneFinalize the orchestrator, preventing further edits.
Must be called before play(). Logs a warning if called multiple times.
parallel
methodparallel(self, *effects: fx.Effect) -> OrchestratorAdd multiple effects to run in parallel.
Args
- *effects — Variable number of Effect objects to run simultaneously.
Returns
- Orchestrator — Self for method chaining.
pause
methodpause(self) -> NonePause the animation at the current position.
play
methodplay(self) -> NoneStart playing the animation from the beginning.
Logs a warning if not finalized or if there are no steps.
resume
methodresume(self) -> NoneResume a paused animation.
rewind
methodrewind(self) -> NoneReset the animation to the beginning without stopping.
stop
methodstop(self) -> NoneStop the animation and reset to the beginning.
then
methodthen(self, effect: fx.Effect) -> OrchestratorAdd a single effect to the timeline.
Args
- effect — The Effect to add.
Returns
- Orchestrator — Self for method chaining.