github_url: | hide |
---|
Inherits: :ref:`StyleBox<class_StyleBox>` < :ref:`Resource<class_Resource>` < :ref:`Reference<class_Reference>` < :ref:`Object<class_Object>`
Texture-based nine-patch :ref:`StyleBox<class_StyleBox>`.
Texture-based nine-patch :ref:`StyleBox<class_StyleBox>`, in a way similar to :ref:`NinePatchRect<class_NinePatchRect>`. This stylebox performs a 3×3 scaling of a texture, where only the center cell is fully stretched. This makes it possible to design bordered styles regardless of the stylebox's size.
Emitted when the stylebox's texture is changed.
enum AxisStretchMode:
Default | 0 |
Setter | set_h_axis_stretch_mode(value) |
Getter | get_h_axis_stretch_mode() |
Controls how the stylebox's texture will be stretched or tiled horizontally. See :ref:`AxisStretchMode<enum_StyleBoxTexture_AxisStretchMode>` for possible values.
Default | 0 |
Setter | set_v_axis_stretch_mode(value) |
Getter | get_v_axis_stretch_mode() |
Controls how the stylebox's texture will be stretched or tiled vertically. See :ref:`AxisStretchMode<enum_StyleBoxTexture_AxisStretchMode>` for possible values.
Default | true |
Setter | set_draw_center(value) |
Getter | is_draw_center_enabled() |
If true
, the nine-patch texture's center tile will be drawn.
Default | 0.0 |
Setter | set_expand_margin_size(value) |
Getter | get_expand_margin_size() |
Expands the bottom margin of this style box when drawing, causing it to be drawn larger than requested.
Default | 0.0 |
Setter | set_expand_margin_size(value) |
Getter | get_expand_margin_size() |
Expands the left margin of this style box when drawing, causing it to be drawn larger than requested.
Default | 0.0 |
Setter | set_expand_margin_size(value) |
Getter | get_expand_margin_size() |
Expands the right margin of this style box when drawing, causing it to be drawn larger than requested.
Default | 0.0 |
Setter | set_expand_margin_size(value) |
Getter | get_expand_margin_size() |
Expands the top margin of this style box when drawing, causing it to be drawn larger than requested.
Default | 0.0 |
Setter | set_margin_size(value) |
Getter | get_margin_size() |
Increases the bottom margin of the 3×3 texture box.
A higher value means more of the source texture is considered to be part of the bottom border of the 3×3 box.
This is also the value used as fallback for :ref:`StyleBox.content_margin_bottom<class_StyleBox_property_content_margin_bottom>` if it is negative.
Default | 0.0 |
Setter | set_margin_size(value) |
Getter | get_margin_size() |
Increases the left margin of the 3×3 texture box.
A higher value means more of the source texture is considered to be part of the left border of the 3×3 box.
This is also the value used as fallback for :ref:`StyleBox.content_margin_left<class_StyleBox_property_content_margin_left>` if it is negative.
Default | 0.0 |
Setter | set_margin_size(value) |
Getter | get_margin_size() |
Increases the right margin of the 3×3 texture box.
A higher value means more of the source texture is considered to be part of the right border of the 3×3 box.
This is also the value used as fallback for :ref:`StyleBox.content_margin_right<class_StyleBox_property_content_margin_right>` if it is negative.
Default | 0.0 |
Setter | set_margin_size(value) |
Getter | get_margin_size() |
Increases the top margin of the 3×3 texture box.
A higher value means more of the source texture is considered to be part of the top border of the 3×3 box.
This is also the value used as fallback for :ref:`StyleBox.content_margin_top<class_StyleBox_property_content_margin_top>` if it is negative.
Default | Color( 1, 1, 1, 1 ) |
Setter | set_modulate(value) |
Getter | get_modulate() |
Modulates the color of the texture when this style box is drawn.
Setter | set_normal_map(value) |
Getter | get_normal_map() |
The normal map to use when drawing this style box.
Default | Rect2( 0, 0, 0, 0 ) |
Setter | set_region_rect(value) |
Getter | get_region_rect() |
Species a sub-region of the texture to use.
This is equivalent to first wrapping the texture in an :ref:`AtlasTexture<class_AtlasTexture>` with the same region.
Setter | set_texture(value) |
Getter | get_texture() |
The texture to use when drawing this style box.
Returns the size of the given margin
's expand margin. See :ref:`Margin<enum_@GlobalScope_Margin>` for possible values.
Returns the size of the given margin
. See :ref:`Margin<enum_@GlobalScope_Margin>` for possible values.
Sets the expand margin to size
pixels for all margins.
Sets the expand margin for each margin to size_left
, size_top
, size_right
, and size_bottom
pixels.
Sets the expand margin to size
pixels for the given margin
. See :ref:`Margin<enum_@GlobalScope_Margin>` for possible values.
Sets the margin to size
pixels for the given margin
. See :ref:`Margin<enum_@GlobalScope_Margin>` for possible values.
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。