diff options
Diffstat (limited to 'scene/gui/texture_button.h')
-rw-r--r-- | scene/gui/texture_button.h | 44 |
1 files changed, 26 insertions, 18 deletions
diff --git a/scene/gui/texture_button.h b/scene/gui/texture_button.h index e39b94abf0..6f7ee65ae4 100644 --- a/scene/gui/texture_button.h +++ b/scene/gui/texture_button.h @@ -34,7 +34,6 @@ #include "scene/gui/base_button.h" #include "scene/resources/bit_map.h" class TextureButton : public BaseButton { - GDCLASS(TextureButton, BaseButton); public: @@ -49,11 +48,11 @@ public: }; private: - Ref<Texture> normal; - Ref<Texture> pressed; - Ref<Texture> hover; - Ref<Texture> disabled; - Ref<Texture> focused; + Ref<Texture2D> normal; + Ref<Texture2D> pressed; + Ref<Texture2D> hover; + Ref<Texture2D> disabled; + Ref<Texture2D> focused; Ref<BitMap> click_mask; bool expand; StretchMode stretch_mode; @@ -62,25 +61,28 @@ private: Rect2 _position_rect; bool _tile; + bool hflip; + bool vflip; + protected: - virtual Size2 get_minimum_size() const; - virtual bool has_point(const Point2 &p_point) const; + virtual Size2 get_minimum_size() const override; + virtual bool has_point(const Point2 &p_point) const override; void _notification(int p_what); static void _bind_methods(); public: - void set_normal_texture(const Ref<Texture> &p_normal); - void set_pressed_texture(const Ref<Texture> &p_pressed); - void set_hover_texture(const Ref<Texture> &p_hover); - void set_disabled_texture(const Ref<Texture> &p_disabled); - void set_focused_texture(const Ref<Texture> &p_focused); + void set_normal_texture(const Ref<Texture2D> &p_normal); + void set_pressed_texture(const Ref<Texture2D> &p_pressed); + void set_hover_texture(const Ref<Texture2D> &p_hover); + void set_disabled_texture(const Ref<Texture2D> &p_disabled); + void set_focused_texture(const Ref<Texture2D> &p_focused); void set_click_mask(const Ref<BitMap> &p_click_mask); - Ref<Texture> get_normal_texture() const; - Ref<Texture> get_pressed_texture() const; - Ref<Texture> get_hover_texture() const; - Ref<Texture> get_disabled_texture() const; - Ref<Texture> get_focused_texture() const; + Ref<Texture2D> get_normal_texture() const; + Ref<Texture2D> get_pressed_texture() const; + Ref<Texture2D> get_hover_texture() const; + Ref<Texture2D> get_disabled_texture() const; + Ref<Texture2D> get_focused_texture() const; Ref<BitMap> get_click_mask() const; bool get_expand() const; @@ -89,6 +91,12 @@ public: void set_stretch_mode(StretchMode p_stretch_mode); StretchMode get_stretch_mode() const; + void set_flip_h(bool p_flip); + bool is_flipped_h() const; + + void set_flip_v(bool p_flip); + bool is_flipped_v() const; + TextureButton(); }; |