|
HatchitGame
|
Defines the base for tween-based components. More...
#include <ht_tween_component.h>
Public Types | |
| typedef float(* | TweenFunction) (float start, float end, float time, float duration) |
| The type for tween function pointers. More... | |
Public Member Functions | |
| TweenComponent () | |
| Creates a new tween component. | |
| virtual | ~TweenComponent () |
| Destroys this tween component. | |
| virtual Core::JSON | VSerialize (void) override |
| virtual bool | VDeserialize (const Core::JSON &jsonObject) override |
| float | GetDuration () const |
| Gets the duration of the tween. | |
| TweenMethod | GetMethod () const |
| Gets the tween method. | |
| TweenPlayMode | GetPlayMode () const |
| Gets the tween play mode. | |
| bool | IsPlaying () const |
| Checks to see if this tween is playing. | |
| bool | Play () |
| Plays the tween. More... | |
| bool | Play (float duration) |
| Plays the tween. More... | |
| bool | Play (float duration, TweenMethod method) |
| Plays the tween. More... | |
| bool | Play (float duration, TweenMethod method, TweenPlayMode mode) |
| Plays the tween. More... | |
| void | SetDuration (float duration) |
| Sets the tween's duration. More... | |
| void | SetMethod (TweenMethod method) |
| Sets the tween method. More... | |
| void | SetPlayMode (TweenPlayMode mode) |
| Sets the play mode. More... | |
| void | Stop () |
| Stops the tween. | |
| void | VOnInit () override |
| Called when the GameObject is created to initialize all values. | |
| virtual void | VOnUpdate () override |
| Called once per frame while the GameObject is enabled. More... | |
| void | VOnDestroy () override |
| Called when the GameObject is destroyed/deleted. More... | |
| Component * | VClone (void) const override |
| Creates a copy of this Component. | |
| virtual Core::Guid | VGetComponentId (void) const override |
| Retrieves the id associated with this class of Component. More... | |
Public Member Functions inherited from Hatchit::Game::Component | |
| Component (const Component &rhs)=default | |
| Component (Component &&rhs)=default | |
| Component & | operator= (const Component &rhs)=default |
| Component & | operator= (Component &&rhs)=default |
| GameObject * | GetOwner (void) |
| Getter which returns the GameObject to which this Component is attached. More... | |
| bool | GetEnabled (void) |
| Getter that returns that value of m_enabled. More... | |
| void | SetEnabled (bool value) |
| Setter that sets the value of m_enabled. More... | |
| void | SetOwner (GameObject *owner) |
| Setter that sets which GameObject this Component is attached to. More... | |
Protected Member Functions | |
| bool | AreValuesCompatible () const |
| Checks to see if the start and end values are compatible. | |
| void | VOnEnabled () override |
| Called when the Component is enabled. More... | |
| void | VOnDisabled () override |
| Called when the Component is disabled. More... | |
Static Protected Member Functions | |
| static void | CreateTweenFunctions () |
| Creates the global list of tween functions. | |
Protected Attributes | |
| TweenValue | m_targetValue |
| TweenValue | m_startValue |
| TweenValue | m_endValue |
| TweenFunction | m_tweenFunction |
| TweenMethod | m_tweenMethod |
| TweenPlayMode | m_tweenPlayMode |
| float | m_startTime |
| float | m_duration |
| bool | m_isPlaying |
Protected Attributes inherited from Hatchit::Game::Component | |
| bool | m_enabled {true} |
| bool indicating if this Component is enabled. More... | |
| GameObject * | m_owner |
| The GameObject to which this Component is attached. More... | |
Static Protected Attributes | |
| static std::vector< TweenFunction > | s_tweenFunctions |
Additional Inherited Members | |
Static Public Member Functions inherited from Hatchit::Game::Component | |
| template<typename T > | |
| static Core::Guid | GetComponentId (void) |
| Returns the unique id associated with a Component of type T. More... | |
Defines the base for tween-based components.
| typedef float(* Hatchit::Game::TweenComponent::TweenFunction) (float start, float end, float time, float duration) |
The type for tween function pointers.
| start | The start value. |
| end | The end value. |
| time | The current time in the tween. |
| duration | The duration of the tween. |
| bool Hatchit::Game::TweenComponent::Play | ( | ) |
Plays the tween.
| bool Hatchit::Game::TweenComponent::Play | ( | float | duration | ) |
Plays the tween.
| duration | The duration of the tween. |
| bool Hatchit::Game::TweenComponent::Play | ( | float | duration, |
| TweenMethod | method | ||
| ) |
Plays the tween.
| duration | The duration of the tween. |
| method | The tween method. |
| bool Hatchit::Game::TweenComponent::Play | ( | float | duration, |
| TweenMethod | method, | ||
| TweenPlayMode | mode | ||
| ) |
Plays the tween.
| duration | The duration of the tween. |
| method | The tween method. |
| mode | The play mode. |
| void Hatchit::Game::TweenComponent::SetDuration | ( | float | duration | ) |
Sets the tween's duration.
| duration | The new duration. |
| void Hatchit::Game::TweenComponent::SetMethod | ( | TweenMethod | method | ) |
Sets the tween method.
| method | The new method. |
| void Hatchit::Game::TweenComponent::SetPlayMode | ( | TweenPlayMode | mode | ) |
Sets the play mode.
| method | The new play mode. |
|
overridevirtual |
Retrieves the id associated with this class of Component.
Implements Hatchit::Game::Component.
Reimplemented in Hatchit::Game::TweenScale, Hatchit::Game::TweenPosition, and Hatchit::Game::TweenRotation.
|
overridevirtual |
Called when the GameObject is destroyed/deleted.
Objects are always disabled before destroyed. When a scene is destroyed, all gameobjects are disabled before any are destroyed.
Implements Hatchit::Game::Component.
|
overrideprotectedvirtual |
Called when the Component is disabled.
Components are always disabled before destroyed. When a scene is destroyed, all Components are disabled before any are destroyed.
Implements Hatchit::Game::Component.
|
overrideprotectedvirtual |
Called when the Component is enabled.
This happens when a scene has finished loading, or immediately after creation if the scene is already loaded.
Implements Hatchit::Game::Component.
|
overridevirtual |
Called once per frame while the GameObject is enabled.
Updates all components first, then all child gameobjects.
Implements Hatchit::Game::Component.
Reimplemented in Hatchit::Game::TweenScale, Hatchit::Game::TweenPosition, and Hatchit::Game::TweenRotation.
1.8.11