Brunot
Loading...
Searching...
No Matches
ChangeOpacityAction.h
Go to the documentation of this file.
1
10// ____ __ __ __
11// /\__ _\/\ \ /\ \/\ \
12// \/_/\ \/\ \ \___ __ \ \ \_\ \ ___ __ __ ____ __
13// \ \ \ \ \ _ `\ /'__`\ \ \ _ \ / __`\/\ \/\ \ /',__\ /'__`\
14// \ \ \ \ \ \ \ \/\ __/ \ \ \ \ \/\ \L\ \ \ \_\ \/\__, `\/\ __/
15// \ \_\ \ \_\ \_\ \____\ \ \_\ \_\ \____/\ \____/\/\____/\ \____\
16// \/_/ \/_/\/_/\/____/ \/_/\/_/\/___/ \/___/ \/___/ \/____/
17
18
19
20
21#pragma once
22#include "Actions/Action.h"
23
24class Sprite;
30{
31public:
32
33#pragma region static_functions
34
35#pragma endregion
36
40 ~ChangeOpacityAction() override = default;
41 ChangeOpacityAction(ChangeOpacityAction&& other) noexcept = default;
42 auto operator=(ChangeOpacityAction&& other) noexcept -> ChangeOpacityAction& = default;
43
44 // I have to comment this one out or else it throws an error
46 ChangeOpacityAction(float endingOpacity, float duration);
47 ChangeOpacityAction(float endingOpacity, float duration, const th::Bezier& easingFunction, float initialDelay, float endingDelay);
48
49#pragma region overridden_functions
50
51
52 auto init() -> void override;
53 auto execute() -> void override;
54 auto end() -> void override;
55
56 auto ActionShowMenu() -> void override;
57 auto render() const -> void override;
58
59
60#pragma endregion
61
62#pragma region newActionStub_functions
63
64#pragma endregion
65
66private:
67
68#pragma region member_variables
69
70
71 // This variable is nice to have just so you don't need to get the component every frame in execute
72 Sprite* sprite = nullptr;
73
74 float startingOpacity = 1.f;
76
77#pragma endregion
78
79#pragma region helper_functions
80
81 #pragma endregion
82
83#pragma region static_variables
84
85#pragma endregion
86
87};
A class that changes a variable over a set duration.
float initialDelay
Definition Action.h:239
float endingDelay
Definition Action.h:240
Action()=default
ChangeOpacityAction(ChangeOpacityAction &&other) noexcept=default
auto operator=(ChangeOpacityAction &&other) noexcept -> ChangeOpacityAction &=default
auto execute() -> void override
Virtual function that is called every frame to change a game object.
Definition ChangeOpacityAction.cpp:54
float endingOpacity
Definition ChangeOpacityAction.h:75
ChangeOpacityAction(const ChangeOpacityAction &)=default
float startingOpacity
Definition ChangeOpacityAction.h:74
auto end() -> void override
Virtual function that is called once, when an Action is finished executing.
Definition ChangeOpacityAction.cpp:59
auto ActionShowMenu() -> void override
Displays a window in imgui.
Definition ChangeOpacityAction.cpp:63
auto init() -> void override
Virtual function that is called once, when the Action is first starting up.
Definition ChangeOpacityAction.cpp:45
~ChangeOpacityAction() override=default
ChangeOpacityAction()=default
auto render() const -> void override
Function used to draw things to screen, useful for things such as debug drawing.
Definition ChangeOpacityAction.cpp:68
auto operator=(const ChangeOpacityAction &) -> ChangeOpacityAction &=default
A component that renders an image on an entity, or text.
Definition Sprite.h:38
Definition Sprite.cpp:344
Definition Bezier.h:30