diff options
author | RĂ©mi Verschelde <rverschelde@gmail.com> | 2017-02-12 23:22:41 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-02-12 23:22:41 +0100 |
commit | b2db9279fac9fa4e8a6891d269e6758a9231722c (patch) | |
tree | 10f651bb74c6f2a777a0ec9baabc7cbac7ac8085 /scene/gui/texture_button.h | |
parent | f3d339e33fa0c0f7e98f4ffee068b153c038bb9b (diff) | |
parent | ab375117ba4e0549fa0b893c3f96a166042f43b9 (diff) |
Merge pull request #7769 from GodotExplorer/pr-resizeable-texturebutton_3
Enhance TextureButton and TextureRect with resize
Diffstat (limited to 'scene/gui/texture_button.h')
-rw-r--r-- | scene/gui/texture_button.h | 17 |
1 files changed, 13 insertions, 4 deletions
diff --git a/scene/gui/texture_button.h b/scene/gui/texture_button.h index ef4d4d5b5b..e1d1079ceb 100644 --- a/scene/gui/texture_button.h +++ b/scene/gui/texture_button.h @@ -31,22 +31,28 @@ #include "scene/gui/base_button.h" #include "scene/resources/bit_mask.h" +#include "scene/gui/texture_rect.h" class TextureButton : public BaseButton { GDCLASS( TextureButton, BaseButton ); +public: + typedef TextureRect::StretchMode StretchMode; + +private: Ref<Texture> normal; Ref<Texture> pressed; Ref<Texture> hover; Ref<Texture> disabled; Ref<Texture> focused; Ref<BitMap> click_mask; - Size2 scale; + bool expand; + StretchMode stretch_mode; protected: - virtual bool has_point(const Point2& p_point) const; virtual Size2 get_minimum_size() const; + virtual bool has_point(const Point2& p_point) const; void _notification(int p_what); static void _bind_methods(); @@ -66,8 +72,11 @@ public: Ref<Texture> get_focused_texture() const; Ref<BitMap> get_click_mask() const; - void set_texture_scale(Size2 p_scale); - Size2 get_texture_scale() const; + bool get_expand() const; + void set_expand(bool p_expand); + + void set_stretch_mode(StretchMode stretch_mode); + StretchMode get_stretch_mode() const; TextureButton(); }; |