Brunot
Loading...
Searching...
No Matches
ChangeColorAction.h
Go to the documentation of this file.
1
10// ____ __ __ __
11// /\__ _\/\ \ /\ \/\ \
12// \/_/\ \/\ \ \___ __ \ \ \_\ \ ___ __ __ ____ __
13// \ \ \ \ \ _ `\ /'__`\ \ \ _ \ / __`\/\ \/\ \ /',__\ /'__`\
14// \ \ \ \ \ \ \ \/\ __/ \ \ \ \ \/\ \L\ \ \ \_\ \/\__, `\/\ __/
15// \ \_\ \ \_\ \_\ \____\ \ \_\ \_\ \____/\ \____/\/\____/\ \____\
16// \/_/ \/_/\/_/\/____/ \/_/\/_/\/___/ \/___/ \/___/ \/____/
17
18#pragma once
19#include "Actions/Action.h"
20#include "Component/Sprite.h"
21
27{
28public:
29
30#pragma region static_functions
31
32#pragma endregion
33
34 ChangeColorAction() = default;
36 auto operator=(const ChangeColorAction&) -> ChangeColorAction& = default;
37 ~ChangeColorAction() override = default;
38 ChangeColorAction(ChangeColorAction&& other) noexcept = default;
39 auto operator=(ChangeColorAction&& other) noexcept -> ChangeColorAction& = default;
40
42 ChangeColorAction(Vector4D endingColor, float duration);
43 ChangeColorAction(Vector4D endingColor, float duration, const th::Bezier& easingFunction, float initialDelay, float endingDelay);
44
45#pragma region overridden_functions
46
47
48 auto init() -> void override;
49 auto execute() -> void override;
50 auto end() -> void override;
51
52 auto ActionShowMenu() -> void override;
53 auto render() const -> void override;
54
55#pragma endregion
56
57#pragma region ChangeColorAction_functions
58
59 auto setColor(const Vector4D& color) -> void;
60
61#pragma endregion
62
63
64private:
65
66#pragma region member_variables
67
68 Sprite* sprite = nullptr;
69
72
73#pragma endregion
74
75#pragma region helper_functions
76
77 #pragma endregion
78
79#pragma region static_variables
80
81#pragma endregion
82
83};
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
ChangeColorAction()=default
auto end() -> void override
Virtual function that is called once, when an Action is finished executing.
Definition ChangeColorAction.cpp:53
auto execute() -> void override
Virtual function that is called every frame to change a game object.
Definition ChangeColorAction.cpp:48
auto operator=(const ChangeColorAction &) -> ChangeColorAction &=default
auto render() const -> void override
Function used to draw things to screen, useful for things such as debug drawing.
Definition ChangeColorAction.cpp:62
Vector4D startingColor
Definition ChangeColorAction.h:70
auto ActionShowMenu() -> void override
Displays a window in imgui.
Definition ChangeColorAction.cpp:57
ChangeColorAction(const ChangeColorAction &)=default
Vector4D endingColor
Definition ChangeColorAction.h:71
auto init() -> void override
Virtual function that is called once, when the Action is first starting up.
Definition ChangeColorAction.cpp:42
Sprite * sprite
Definition ChangeColorAction.h:68
auto operator=(ChangeColorAction &&other) noexcept -> ChangeColorAction &=default
~ChangeColorAction() override=default
auto setColor(const Vector4D &color) -> void
Definition ChangeColorAction.cpp:67
ChangeColorAction(ChangeColorAction &&other) noexcept=default
A component that renders an image on an entity, or text.
Definition Sprite.h:38
Definition Vector4D.h:28
Definition Bezier.h:30