17#ifndef _FGE_C_OBJBUTTON_HPP_INCLUDED
18#define _FGE_C_OBJBUTTON_HPP_INCLUDED
20#include "FastEngine/fge_extern.hpp"
21#include "C_objSprite.hpp"
22#include "C_object.hpp"
23#include "FastEngine/C_guiElement.hpp"
25#define FGE_OBJBUTTON_CLASSNAME "FGE:OBJ:BUTTON"
35 explicit ObjButton(
fge::Texture texture, fge::Vector2f
const& pos = fge::Vector2f());
43 void setTexture(
fge::Texture const& texture,
bool resetRect =
false);
44 void setTextureOn(
fge::Texture const& textureOn,
bool resetRect =
false);
45 void setTextureOff(
fge::Texture const& textureOff,
bool resetRect =
false);
46 void setTextureRect(fge::RectInt
const& rectangle);
47 void setTextureOnRect(fge::RectInt
const& rectangle);
48 void setTextureOffRect(fge::RectInt
const& rectangle);
52 void setActiveStat(
bool active);
53 bool getActiveStat()
const;
59 void save(nlohmann::json& jsonObject)
override;
60 void load(nlohmann::json& jsonObject, std::filesystem::path
const& filePath)
override;
75 void onMouseButtonReleased(
fge::Event const& evt, SDL_MouseButtonEvent
const& arg);
84 fge::RectInt g_textureRectOn;
85 fge::RectInt g_textureRectOff;
89 bool g_statMouseOn =
false;
90 bool g_statActive =
false;
This class is used to handle callbacks in a safe way.
Definition C_callback.hpp:189
Definition C_color.hpp:35
This class is a wrapper for SDL events.
Definition C_event.hpp:59
A class to handle highest priority selection of GUI elements.
Definition C_guiElement.hpp:235
A base class for all GUI elements.
Definition C_guiElement.hpp:120
Definition C_objSprite.hpp:30
The Object class is the base class for all objects in the engine.
Definition C_object.hpp:102
This class is a useful utility to "link" multiple objects around.
Definition C_subscription.hpp:150
This class is a wrapper for the texture manager to allow easy manipulation.
Definition C_texture.hpp:36
Definition C_packet.hpp:52
Definition C_guiElement.hpp:45