Brunot
Loading...
Searching...
No Matches
FlashColor.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 Sprite;
27class FlashColor : public Action
28{
29public:
30
31#pragma region static_functions
32
33#pragma endregion
34
35 FlashColor() = default;
36 FlashColor(const FlashColor&) = default;
37 auto operator=(const FlashColor&) -> FlashColor& = default;
38 ~FlashColor() override = default;
39 FlashColor(FlashColor&& other) noexcept = default;
40 auto operator=(FlashColor&& other) noexcept -> FlashColor& = default;
41
42 FlashColor(Vector4D color);
43 FlashColor(Vector4D color, float duration);
44 FlashColor(Vector4D color, float duration, const th::Bezier& easingFunction, float initialDelay, float endingDelay);
45
46#pragma region overridden_functions
47
48
49 auto init() -> void override;
50 auto execute() -> void override;
51 auto end() -> void override;
52
53 auto ActionShowMenu() -> void override;
54 auto render() const -> void override;
55
56
57#pragma endregion
58
59#pragma region FlashColor_functions
60
61#pragma endregion
62
63private:
64
65#pragma region member_variables
66
67 Sprite* sprite = nullptr;
68
71
72 bool colorChanging = false;
73
74#pragma endregion
75
76#pragma region helper_functions
77
78 #pragma endregion
79
80#pragma region static_variables
81
82#pragma endregion
83
84};
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
Vector4D flashColor
Definition FlashColor.h:70
auto init() -> void override
Virtual function that is called once, when the Action is first starting up.
Definition FlashColor.cpp:45
~FlashColor() override=default
auto ActionShowMenu() -> void override
Displays a window in imgui.
Definition FlashColor.cpp:72
FlashColor(FlashColor &&other) noexcept=default
Vector4D startingColor
Definition FlashColor.h:69
auto render() const -> void override
Function used to draw things to screen, useful for things such as debug drawing.
Definition FlashColor.cpp:77
FlashColor()=default
auto operator=(const FlashColor &) -> FlashColor &=default
bool colorChanging
Definition FlashColor.h:72
auto end() -> void override
Virtual function that is called once, when an Action is finished executing.
Definition FlashColor.cpp:68
auto execute() -> void override
Virtual function that is called every frame to change a game object.
Definition FlashColor.cpp:51
Sprite * sprite
Definition FlashColor.h:67
FlashColor(const FlashColor &)=default
auto operator=(FlashColor &&other) noexcept -> FlashColor &=default
A component that renders an image on an entity, or text.
Definition Sprite.h:38
Definition Vector4D.h:28
Definition Bezier.h:30