diff options
author | hop311 <hop3114@gmail.com> | 2024-08-28 19:46:30 +0200 |
---|---|---|
committer | hop311 <hop3114@gmail.com> | 2024-08-28 23:51:31 +0200 |
commit | 88acb31bd43f0e163522837bb1d0dd7da2977c4a (patch) | |
tree | 241cbf8cf21a7cdfe1c870469ac3b3ef3064bdb3 /extension/src/openvic-extension/classes/GUIIcon.hpp | |
parent | d7672f406406eea46625bc725690651f28211e19 (diff) |
Switch to using custom UI nodes
Diffstat (limited to 'extension/src/openvic-extension/classes/GUIIcon.hpp')
-rw-r--r-- | extension/src/openvic-extension/classes/GUIIcon.hpp | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/extension/src/openvic-extension/classes/GUIIcon.hpp b/extension/src/openvic-extension/classes/GUIIcon.hpp new file mode 100644 index 0000000..e8e3014 --- /dev/null +++ b/extension/src/openvic-extension/classes/GUIIcon.hpp @@ -0,0 +1,34 @@ +#pragma once + +#include "openvic-extension/classes/GFXSpriteTexture.hpp" +#include "openvic-extension/classes/GUITextureRect.hpp" + +namespace OpenVic { + class GUIIcon : public GUITextureRect { + GDCLASS(GUIIcon, GUITextureRect) + + godot::Ref<GFXSpriteTexture> gfx_sprite_texture; + + protected: + static void _bind_methods(); + + public: + godot::Error set_gfx_texture_sprite( + GFX::TextureSprite const* gfx_texture_sprite, GFX::frame_t icon = GFX::NO_FRAMES + ); + + godot::Ref<GFXSpriteTexture> get_gfx_sprite_texture() const; + + godot::Error set_gfx_texture_sprite_name( + godot::String const& gfx_texture_sprite_name, GFX::frame_t icon = GFX::NO_FRAMES + ); + + godot::String get_gfx_texture_sprite_name() const; + + godot::Error set_icon_index(GFX::frame_t icon_index) const; + + GFX::frame_t get_icon_index() const; + + godot::Error set_toggled_icon(bool toggled) const; + }; +} |