Table of Contents

Class StyleBoxTexture

Namespace
Godot
Assembly
GodotSharp.dll

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.

public class StyleBoxTexture : StyleBox, IDisposable
Inheritance
StyleBoxTexture
Implements
Inherited Members

Constructors

StyleBoxTexture()

public StyleBoxTexture()

Properties

AxisStretchHorizontal

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

public StyleBoxTexture.AxisStretchMode AxisStretchHorizontal { get; set; }

Property Value

StyleBoxTexture.AxisStretchMode

AxisStretchVertical

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

public StyleBoxTexture.AxisStretchMode AxisStretchVertical { get; set; }

Property Value

StyleBoxTexture.AxisStretchMode

DrawCenter

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

public bool DrawCenter { get; set; }

Property Value

bool

ExpandMarginBottom

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

public float ExpandMarginBottom { get; set; }

Property Value

float

ExpandMarginLeft

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

public float ExpandMarginLeft { get; set; }

Property Value

float

ExpandMarginRight

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

public float ExpandMarginRight { get; set; }

Property Value

float

ExpandMarginTop

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

public float ExpandMarginTop { get; set; }

Property Value

float

ModulateColor

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

public Color ModulateColor { get; set; }

Property Value

Color

RegionRect

Species a sub-region of the texture to use.

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 will be used.

public Rect2 RegionRect { get; set; }

Property Value

Rect2

Texture

The texture to use when drawing this style box.

public Texture2D Texture { get; set; }

Property Value

Texture2D

TextureMarginBottom

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

public float TextureMarginBottom { get; set; }

Property Value

float

TextureMarginLeft

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

public float TextureMarginLeft { get; set; }

Property Value

float

TextureMarginRight

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

public float TextureMarginRight { get; set; }

Property Value

float

TextureMarginTop

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

public float TextureMarginTop { get; set; }

Property Value

float

Methods

HasGodotClassMethod(in godot_string_name)

Check if the type contains a method with the given name. This method is used by Godot to check if a method exists before invoking it. Do not call or override this method.

protected override bool HasGodotClassMethod(in godot_string_name method)

Parameters

method godot_string_name

Name of the method to check for.

Returns

bool

HasGodotClassSignal(in godot_string_name)

Check if the type contains a signal with the given name. This method is used by Godot to check if a signal exists before raising it. Do not call or override this method.

protected override bool HasGodotClassSignal(in godot_string_name signal)

Parameters

signal godot_string_name

Name of the signal to check for.

Returns

bool

InvokeGodotClassMethod(in godot_string_name, NativeVariantPtrArgs, out godot_variant)

Invokes the method with the given name, using the given arguments. This method is used by Godot to invoke methods from the engine side. Do not call or override this method.

protected override bool InvokeGodotClassMethod(in godot_string_name method, NativeVariantPtrArgs args, out godot_variant ret)

Parameters

method godot_string_name

Name of the method to invoke.

args NativeVariantPtrArgs

Arguments to use with the invoked method.

ret godot_variant

Value returned by the invoked method.

Returns

bool

SetExpandMarginAll(float)

Sets the expand margin to size pixels for all sides.

public void SetExpandMarginAll(float size)

Parameters

size float

SetTextureMarginAll(float)

Sets the margin to size pixels for all sides.

public void SetTextureMarginAll(float size)

Parameters

size float