Brunot
Loading...
Searching...
No Matches
ChangeScaleAction.h
Go to the documentation of this file.
1
11// ____ __ __ __
12// /\__ _\/\ \ /\ \/\ \
13// \/_/\ \/\ \ \___ __ \ \ \_\ \ ___ __ __ ____ __
14// \ \ \ \ \ _ `\ /'__`\ \ \ _ \ / __`\/\ \/\ \ /',__\ /'__`\
15// \ \ \ \ \ \ \ \/\ __/ \ \ \ \ \/\ \L\ \ \ \_\ \/\__, `\/\ __/
16// \ \_\ \ \_\ \_\ \____\ \ \_\ \_\ \____/\ \____/\/\____/\ \____\
17// \/_/ \/_/\/_/\/____/ \/_/\/_/\/___/ \/___/ \/___/ \/____/
18
19
20#pragma once
21#include "Actions/Action.h"
22
23class Transform;
29{
30public:
31
32#pragma region static_functions
33
34#pragma endregion
35
36 ChangeScaleAction() = default;
38 auto operator=(const ChangeScaleAction&) -> ChangeScaleAction& = default;
39 ~ChangeScaleAction() override = default;
40 ChangeScaleAction(ChangeScaleAction&& other) noexcept = default;
41 auto operator=(ChangeScaleAction&& other) noexcept -> ChangeScaleAction& = default;
42
44 ChangeScaleAction(Vector4D endingScale, float duration);
46 ChangeScaleAction(Vector4D endingScale, float duration, const th::Bezier& easingFunction, float initialDelay, float endingDelay);
47
49 ChangeScaleAction(float endingScale, float duration);
50 ChangeScaleAction(float endingScale, float duration, bool isWorldScale);
51 ChangeScaleAction(float endingScale, float duration, const th::Bezier& easingFunction, float initialDelay, float endingDelay);
52
53#pragma region overridden_functions
54
55
56 auto init() -> void override;
57 auto execute() -> void override;
58 auto end() -> void override;
59
60 auto ActionShowMenu() -> void override;
61 auto render() const -> void override;
62
63
64#pragma endregion
65
66#pragma region ChangeScaleAction_functions
67
68 auto setIsWorldScale(bool newState) -> void;
69
70#pragma endregion
71
72private:
73
74#pragma region member_variables
75
76 Transform* transform = nullptr;
77
80
81 bool isWorldScale = true;
82
84 bool changingZ = true;
85
86
87#pragma endregion
88
89#pragma region helper_functions
90
91 #pragma endregion
92
93#pragma region static_variables
94
95#pragma endregion
96
97};
A class that changes a variable over a set duration.
float initialDelay
Delay that acts between the action being created and the action initializing.
Definition Action.h:262
float endingDelay
Delay that acts after the action has finished updating but before it has ended.
Definition Action.h:264
Action()=default
auto ActionShowMenu() -> void override
Displays a window in imgui.
Definition ChangeScaleAction.cpp:119
bool changingZ
Used to track if we want to change the z-value or not.
Definition ChangeScaleAction.h:84
Vector4D endingScale
Definition ChangeScaleAction.h:79
ChangeScaleAction()=default
Transform * transform
Definition ChangeScaleAction.h:76
auto execute() -> void override
Virtual function that is called every frame to change a game object.
Definition ChangeScaleAction.cpp:103
ChangeScaleAction(ChangeScaleAction &&other) noexcept=default
~ChangeScaleAction() override=default
bool isWorldScale
Definition ChangeScaleAction.h:81
auto setIsWorldScale(bool newState) -> void
Definition ChangeScaleAction.cpp:129
auto operator=(const ChangeScaleAction &) -> ChangeScaleAction &=default
auto operator=(ChangeScaleAction &&other) noexcept -> ChangeScaleAction &=default
auto end() -> void override
Virtual function that is called once, when an Action is finished executing.
Definition ChangeScaleAction.cpp:115
auto init() -> void override
Virtual function that is called once, when the Action is first starting up.
Definition ChangeScaleAction.cpp:85
auto render() const -> void override
Function used to draw things to screen, useful for things such as debug drawing.
Definition ChangeScaleAction.cpp:124
Vector4D startingScale
Definition ChangeScaleAction.h:78
ChangeScaleAction(const ChangeScaleAction &)=default
Definition Transform.h:28
Definition Vector4D.h:28
Definition Bezier.h:30