aboutsummaryrefslogtreecommitdiff
path: root/extension/src/openvic-extension/classes/GUIIcon.hpp
blob: e8e3014adfdbdf2fd25fb7ea587d4c825ff903f9 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
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;
   };
}