Table of Contents

Class StyleBoxTexture

A texture-based nine-patch StyleBox.

Inheritance
StyleBoxTexture

Remarks

A texture-based nine-patch StyleBox, in a way similar to 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.

Properties

axis_stretch_horizontal

Controls how the stylebox's texture will be stretched or tiled horizontally. See AxisStretchMode for possible values.

var axis_stretch_horizontal : int = 0

Property Value

int

Remarks

  • void set_h_axis_stretch_mode(int value)
  • int get_h_axis_stretch_mode

axis_stretch_vertical

Controls how the stylebox's texture will be stretched or tiled vertically. See AxisStretchMode for possible values.

var axis_stretch_vertical : int = 0

Property Value

int

Remarks

  • void set_v_axis_stretch_mode(int value)
  • int get_v_axis_stretch_mode

draw_center

If true, the nine-patch texture's center tile will be drawn.

var draw_center : bool = true

Property Value

bool

Remarks

  • void set_draw_center(bool value)
  • bool is_draw_center_enabled

expand_margin_bottom

Expands the bottom margin of this style box when drawing, causing it to be drawn larger than requested.

var expand_margin_bottom : float = 0.0

Property Value

float

Remarks

  • void set_expand_margin(int margin, float size)
  • float get_expand_margin(int margin)

expand_margin_left

Expands the left margin of this style box when drawing, causing it to be drawn larger than requested.

var expand_margin_left : float = 0.0

Property Value

float

Remarks

  • void set_expand_margin(int margin, float size)
  • float get_expand_margin(int margin)

expand_margin_right

Expands the right margin of this style box when drawing, causing it to be drawn larger than requested.

var expand_margin_right : float = 0.0

Property Value

float

Remarks

  • void set_expand_margin(int margin, float size)
  • float get_expand_margin(int margin)

expand_margin_top

Expands the top margin of this style box when drawing, causing it to be drawn larger than requested.

var expand_margin_top : float = 0.0

Property Value

float

Remarks

  • void set_expand_margin(int margin, float size)
  • float get_expand_margin(int margin)

modulate_color

Modulates the color of the texture when this style box is drawn.

var modulate_color : Color = Color(1, 1, 1, 1)

Property Value

Color

Remarks

  • void set_modulate(Color value)
  • Color get_modulate

region_rect

The region to use from the texture.

This is equivalent to first wrapping the texture in an AtlasTexture with the same region.

If empty (Rect2(0, 0, 0, 0)), the whole texture is used.

var region_rect : Rect2 = Rect2(0, 0, 0, 0)

Property Value

Rect2

Remarks

  • void set_region_rect(Rect2 value)
  • Rect2 get_region_rect

texture

The texture to use when drawing this style box.

var texture : Texture2D

Property Value

Texture2D

Remarks

texture_margin_bottom

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 content_margin_bottom if it is negative.

var texture_margin_bottom : float = 0.0

Property Value

float

Remarks

  • void set_texture_margin(int margin, float size)
  • float get_texture_margin(int margin)

texture_margin_left

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 content_margin_left if it is negative.

var texture_margin_left : float = 0.0

Property Value

float

Remarks

  • void set_texture_margin(int margin, float size)
  • float get_texture_margin(int margin)

texture_margin_right

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 content_margin_right if it is negative.

var texture_margin_right : float = 0.0

Property Value

float

Remarks

  • void set_texture_margin(int margin, float size)
  • float get_texture_margin(int margin)

texture_margin_top

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 content_margin_top if it is negative.

var texture_margin_top : float = 0.0

Property Value

float

Remarks

  • void set_texture_margin(int margin, float size)
  • float get_texture_margin(int margin)

Methods

get_expand_margin(int)

Qualifiers: const

Returns the expand margin size of the specified Side.

float get_expand_margin(int margin)

Parameters

margin int

get_texture_margin(int)

Qualifiers: const

Returns the margin size of the specified Side.

float get_texture_margin(int margin)

Parameters

margin int

set_expand_margin(int, float)

Sets the expand margin to size pixels for the specified Side.

void set_expand_margin(int margin, float size)

Parameters

margin int
size float

set_expand_margin_all(float)

Sets the expand margin to size pixels for all sides.

void set_expand_margin_all(float size)

Parameters

size float

set_texture_margin(int, float)

Sets the margin to size pixels for the specified Side.

void set_texture_margin(int margin, float size)

Parameters

margin int
size float

set_texture_margin_all(float)

Sets the margin to size pixels for all sides.

void set_texture_margin_all(float size)

Parameters

size float