diff options
Diffstat (limited to 'src/crepe/api/Button.h')
-rw-r--r-- | src/crepe/api/Button.h | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/src/crepe/api/Button.h b/src/crepe/api/Button.h index 25709a4..f6d363a 100644 --- a/src/crepe/api/Button.h +++ b/src/crepe/api/Button.h @@ -18,14 +18,23 @@ namespace crepe { */ class Button : public UIObject { public: + struct Data { + //! variable indicating if transform is relative to camera(false) or world(true) + bool world_space = false; + }; + +public: /** * \brief Constructs a Button with the specified game object ID and dimensions. * * \param id The unique ID of the game object associated with this button. * \param dimensions The width and height of the UIObject * \param offset The offset relative this GameObjects Transform + * \param data additional data the button has */ - Button(game_object_id_t id, const vec2 & dimensions, const vec2 & offset); + Button( + game_object_id_t id, const vec2 & dimensions, const vec2 & offset, const Data & data + ); /** * \brief Get the maximum number of instances for this component * @@ -41,8 +50,7 @@ private: //! Indicates whether the mouse is currently hovering over the button bool hover = false; - //! variable indicating if transform is relative to camera(false) or world(true) - bool world_space = false; + Data data; }; } // namespace crepe |