Tween¶
- class transytion.Tween(duration: float, obj: ~typing.Any, targets: dict[str, float], start: dict[str, float] | None = None, ease_func: ~collections.abc.Callable[[float], float] = <function linear>, before_execution: ~collections.abc.Callable[[], None] = <function Tween.<lambda>>, callback: ~collections.abc.Callable[[], None] = <function Tween.<lambda>>, on_pause: ~collections.abc.Callable[[], None] = <function Tween.<lambda>>, on_remove: ~collections.abc.Callable[[], None] = <function Tween.<lambda>>, args: tuple[~typing.Any, ...] = (), repeat_count: int = 1)¶
Bases:
objectA list of TweenNodes with some organizational skills.
Attributes Summary
Get the args for the final callback.
Get the final callback.
Determine if a tween has finished going forward or backward.
Methods Summary
pause()Pause a tween.
reset()Restarts a tween from the beginning.
resume()Resume a tween.
then(other)update(dt)Updates the current TweenNode and transitions to the next TweenNode if the current one has finished updating.
Attributes Documentation
- args¶
Get the args for the final callback.
- callback¶
Get the final callback.
- finished¶
Determine if a tween has finished going forward or backward.
Methods Documentation
- pause()¶
Pause a tween. Tells the manager of this tween to put it in the paused tweens list.
- reset()¶
Restarts a tween from the beginning.
- resume()¶
Resume a tween. If the tween was paused, it is now put in the active tween list and resumed by it’s manager.
- then(other)¶
- update(dt) None¶
Updates the current TweenNode and transitions to the next TweenNode if the current one has finished updating.