Brunot
Loading...
Searching...
No Matches
ChangeZLayerAction.h
Go to the documentation of this file.
1
10// ____ __ __ __
11// /\__ _\/\ \ /\ \/\ \
12// \/_/\ \/\ \ \___ __ \ \ \_\ \ ___ __ __ ____ __
13// \ \ \ \ \ _ `\ /'__`\ \ \ _ \ / __`\/\ \/\ \ /',__\ /'__`\
14// \ \ \ \ \ \ \ \/\ __/ \ \ \ \ \/\ \L\ \ \ \_\ \/\__, `\/\ __/
15// \ \_\ \ \_\ \_\ \____\ \ \_\ \_\ \____/\ \____/\/\____/\ \____\
16// \/_/ \/_/\/_/\/____/ \/_/\/_/\/___/ \/___/ \/___/ \/____/
17
18
19#pragma once
20#include "Actions/Action.h"
21
22class Transform;
27{
28public:
29
30#pragma region static_functions
31
32#pragma endregion
33
34 ChangeZLayerAction() = default;
37 ~ChangeZLayerAction() override = default;
38 ChangeZLayerAction(ChangeZLayerAction&& other) noexcept = default;
39 auto operator=(ChangeZLayerAction&& other) noexcept -> ChangeZLayerAction& = default;
40
49 ChangeZLayerAction(float endingZLayer, float duration);
57 ChangeZLayerAction(float endingZLayer, float duration, const th::Bezier& easingFunction, float initialDelay, float endingDelay);
58
59#pragma region overridden_functions
60
61
62 auto init() -> void override;
63 auto execute() -> void override;
64 auto end() -> void override;
65
66 auto ActionShowMenu() -> void override;
67 auto render() const -> void override;
68
69
70#pragma endregion
71
72#pragma region ChangeZLayerAction_functions
73
74#pragma endregion
75
76private:
77
78#pragma region member_variables
79
80
81 // This variable is nice to have just so you don't need to get the transform every frame in execute
82 Transform* transform = nullptr;
83
84 float startingZLayer = 0.f;
86
87
88#pragma endregion
89
90#pragma region helper_functions
91
92 #pragma endregion
93
94#pragma region static_variables
95
96#pragma endregion
97
98};
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 operator=(ChangeZLayerAction &&other) noexcept -> ChangeZLayerAction &=default
auto ActionShowMenu() -> void override
Displays a window in imgui.
Definition ChangeZLayerAction.cpp:65
ChangeZLayerAction()=default
ChangeZLayerAction(const ChangeZLayerAction &)=default
auto end() -> void override
Virtual function that is called once, when an Action is finished executing.
Definition ChangeZLayerAction.cpp:61
float endingZLayer
Definition ChangeZLayerAction.h:85
auto execute() -> void override
Virtual function that is called every frame to change a game object.
Definition ChangeZLayerAction.cpp:55
Transform * transform
Definition ChangeZLayerAction.h:82
auto operator=(const ChangeZLayerAction &) -> ChangeZLayerAction &=default
auto render() const -> void override
Function used to draw things to screen, useful for things such as debug drawing.
Definition ChangeZLayerAction.cpp:70
float startingZLayer
Definition ChangeZLayerAction.h:84
auto init() -> void override
Virtual function that is called once, when the Action is first starting up.
Definition ChangeZLayerAction.cpp:46
~ChangeZLayerAction() override=default
ChangeZLayerAction(ChangeZLayerAction &&other) noexcept=default
Definition Transform.h:28
Definition Bezier.h:30