aboutsummaryrefslogtreecommitdiff
path: root/extension/src/openvic-extension/classes/GUIIconButton.hpp
blob: 10fc1791a97af7f6f87a91d4b30ad98ba5172d57 (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
35
36
#pragma once

#include "openvic-extension/classes/GFXSpriteTexture.hpp"
#include "openvic-extension/classes/GUIButton.hpp"

namespace OpenVic {
   class GUIIconButton : public GUIButton {
      GDCLASS(GUIIconButton, GUIButton)

      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;

      void _toggled(bool toggled_on) override;
   };
}