diff options
Diffstat (limited to 'scene/resources/style_box.h')
-rw-r--r-- | scene/resources/style_box.h | 37 |
1 files changed, 14 insertions, 23 deletions
diff --git a/scene/resources/style_box.h b/scene/resources/style_box.h index f19b93d00d..a1237776c6 100644 --- a/scene/resources/style_box.h +++ b/scene/resources/style_box.h @@ -31,14 +31,13 @@ #ifndef STYLE_BOX_H #define STYLE_BOX_H -#include "core/resource.h" +#include "core/io/resource.h" #include "scene/resources/texture.h" #include "servers/rendering_server.h" class CanvasItem; class StyleBox : public Resource { - GDCLASS(StyleBox, Resource); RES_BASE_EXTENSION("stylebox"); OBJ_SAVE_TYPE(StyleBox); @@ -68,17 +67,15 @@ public: }; class StyleBoxEmpty : public StyleBox { - GDCLASS(StyleBoxEmpty, StyleBox); - virtual float get_style_margin(Margin p_margin) const { return 0; } + virtual float get_style_margin(Margin p_margin) const override { return 0; } public: - virtual void draw(RID p_canvas_item, const Rect2 &p_rect) const {} + virtual void draw(RID p_canvas_item, const Rect2 &p_rect) const override {} StyleBoxEmpty() {} }; class StyleBoxTexture : public StyleBox { - GDCLASS(StyleBoxTexture, StyleBox); public: @@ -93,14 +90,13 @@ private: float margin[4]; Rect2 region_rect; Ref<Texture2D> texture; - Ref<Texture2D> normal_map; bool draw_center; Color modulate; AxisStretchMode axis_h; AxisStretchMode axis_v; protected: - virtual float get_style_margin(Margin p_margin) const; + virtual float get_style_margin(Margin p_margin) const override; static void _bind_methods(); public: @@ -118,12 +114,9 @@ public: void set_texture(Ref<Texture2D> p_texture); Ref<Texture2D> get_texture() const; - void set_normal_map(Ref<Texture2D> p_normal_map); - Ref<Texture2D> get_normal_map() const; - void set_draw_center(bool p_enabled); bool is_draw_center_enabled() const; - virtual Size2 get_center_size() const; + virtual Size2 get_center_size() const override; void set_h_axis_stretch_mode(AxisStretchMode p_mode); AxisStretchMode get_h_axis_stretch_mode() const; @@ -134,8 +127,8 @@ public: void set_modulate(const Color &p_modulate); Color get_modulate() const; - virtual Rect2 get_draw_rect(const Rect2 &p_rect) const; - virtual void draw(RID p_canvas_item, const Rect2 &p_rect) const; + virtual Rect2 get_draw_rect(const Rect2 &p_rect) const override; + virtual void draw(RID p_canvas_item, const Rect2 &p_rect) const override; StyleBoxTexture(); ~StyleBoxTexture(); @@ -144,7 +137,6 @@ public: VARIANT_ENUM_CAST(StyleBoxTexture::AxisStretchMode) class StyleBoxFlat : public StyleBox { - GDCLASS(StyleBoxFlat, StyleBox); Color bg_color; @@ -165,7 +157,7 @@ class StyleBoxFlat : public StyleBox { int aa_size; protected: - virtual float get_style_margin(Margin p_margin) const; + virtual float get_style_margin(Margin p_margin) const override; static void _bind_methods(); public: @@ -227,10 +219,10 @@ public: void set_aa_size(const int &p_aa_size); int get_aa_size() const; - virtual Size2 get_center_size() const; + virtual Size2 get_center_size() const override; - virtual Rect2 get_draw_rect(const Rect2 &p_rect) const; - virtual void draw(RID p_canvas_item, const Rect2 &p_rect) const; + virtual Rect2 get_draw_rect(const Rect2 &p_rect) const override; + virtual void draw(RID p_canvas_item, const Rect2 &p_rect) const override; StyleBoxFlat(); ~StyleBoxFlat(); @@ -238,7 +230,6 @@ public: // just used to draw lines. class StyleBoxLine : public StyleBox { - GDCLASS(StyleBoxLine, StyleBox); Color color; int thickness; @@ -247,7 +238,7 @@ class StyleBoxLine : public StyleBox { float grow_end; protected: - virtual float get_style_margin(Margin p_margin) const; + virtual float get_style_margin(Margin p_margin) const override; static void _bind_methods(); public: @@ -266,9 +257,9 @@ public: void set_grow_end(float p_grow); float get_grow_end() const; - virtual Size2 get_center_size() const; + virtual Size2 get_center_size() const override; - virtual void draw(RID p_canvas_item, const Rect2 &p_rect) const; + virtual void draw(RID p_canvas_item, const Rect2 &p_rect) const override; StyleBoxLine(); ~StyleBoxLine(); |