TweenBase
TweenBase : Instance
Overview
The TweenBase class provides the foundational structure for handling Tween animations, allowing developers to control and monitor the animation lifecycle.
Description
The TweenBase class serves as the parent class for objects like Tween, offering fundamental methods and properties for initiating, pausing, canceling, and tracking the state of animations. Its design ensures a consistent and reliable workflow for managing various types of animations in game development.
Properties
PlaybackState
Enum.PlaybackState
The PlaybackState
property represents the current state of the Tween. It can be set to values like Playing, Paused, or Canceled, allowing developers to track the animation's progress and control its behavior.
Code Samples
Methods
Cancel
The Cancel
method immediately stops the Tween animation and resets it to its initial state, discarding any progress made during the animation.
Parameters
Return
void
Code Samples
Pause
The Pause
method temporarily halts the Tween animation, allowing it to resume later while maintaining its current progress.
Parameters
Return
void
Code Samples
Play
The Play
method starts or resumes the Tween animation from its current position, allowing it to transition toward its goal as specified.
Parameters
Return
void
Code Samples
Events
Completed
The Completed
event is triggered when the Tween finishes playing, either through reaching its natural end or after being stopped with the Play
method.