Documentation
¶
Overview ¶
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.
Index ¶
- type Advanced
- type Any
- type AxisStretchMode
- type Extension
- type ID
- type Instance
- func (self Instance) AsObject() [1]gd.Object
- func (self Instance) AsRefCounted() [1]gd.RefCounted
- func (self Instance) AsResource() Resource.Instance
- func (self Instance) AsStyleBox() StyleBox.Instance
- func (self Instance) AsStyleBoxTexture() Instance
- func (self Instance) AxisStretchHorizontal() AxisStretchMode
- func (self Instance) AxisStretchVertical() AxisStretchMode
- func (self Instance) DrawCenter() bool
- func (self Instance) ExpandMarginBottom() Float.X
- func (self Instance) ExpandMarginLeft() Float.X
- func (self Instance) ExpandMarginRight() Float.X
- func (self Instance) ExpandMarginTop() Float.X
- func (self Instance) ID() ID
- func (self Instance) ModulateColor() Color.RGBA
- func (self Instance) RegionRect() Rect2.PositionSize
- func (self Instance) SetAxisStretchHorizontal(value AxisStretchMode)
- func (self Instance) SetAxisStretchVertical(value AxisStretchMode)
- func (self Instance) SetDrawCenter(value bool)
- func (self Instance) SetExpandMarginAll(size Float.X)
- func (self Instance) SetExpandMarginBottom(value Float.X)
- func (self Instance) SetExpandMarginLeft(value Float.X)
- func (self Instance) SetExpandMarginRight(value Float.X)
- func (self Instance) SetExpandMarginTop(value Float.X)
- func (self Instance) SetModulateColor(value Color.RGBA)
- func (self *Instance) SetObject(obj [1]gd.Object) bool
- func (self Instance) SetRegionRect(value Rect2.PositionSize)
- func (self Instance) SetTexture(value Texture2D.Instance)
- func (self Instance) SetTextureMarginAll(size Float.X)
- func (self Instance) SetTextureMarginBottom(value Float.X)
- func (self Instance) SetTextureMarginLeft(value Float.X)
- func (self Instance) SetTextureMarginRight(value Float.X)
- func (self Instance) SetTextureMarginTop(value Float.X)
- func (self Instance) Texture() Texture2D.Instance
- func (self Instance) TextureMarginBottom() Float.X
- func (self Instance) TextureMarginLeft() Float.X
- func (self Instance) TextureMarginRight() Float.X
- func (self Instance) TextureMarginTop() Float.X
- func (self Instance) Virtual(name string) reflect.Value
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Advanced ¶
type Advanced = class
Advanced exposes a 1:1 low-level instance of the class, undocumented, for those who know what they are doing.
type AxisStretchMode ¶
type AxisStretchMode int //gd:StyleBoxTexture.AxisStretchMode
const ( // Stretch the stylebox's texture. This results in visible distortion unless the texture size matches the stylebox's size perfectly. AxisStretchModeStretch AxisStretchMode = 0 // Repeats the stylebox's texture to match the stylebox's size according to the nine-patch system. AxisStretchModeTile AxisStretchMode = 1 // Repeats the stylebox's texture to match the stylebox's size according to the nine-patch system. Unlike [AxisStretchModeTile], the texture may be slightly stretched to make the nine-patch texture tile seamlessly. AxisStretchModeTileFit AxisStretchMode = 2 )
type Extension ¶
Extension can be embedded in a new struct to create an extension of this class. T should be the type that is embedding this Extension
func (*Extension[T]) AsRefCounted ¶
func (self *Extension[T]) AsRefCounted() [1]gd.RefCounted
func (*Extension[T]) AsResource ¶
func (*Extension[T]) AsStyleBox ¶
func (*Extension[T]) AsStyleBoxTexture ¶
type ID ¶
ID is a typed object ID (reference) to an instance of this class, use it to store references to objects with unknown lifetimes, as an ID will not panic on use if the underlying object has been destroyed.
type Instance ¶
type Instance [1]gdclass.StyleBoxTexture
Instance of the class with convieniently typed arguments and results.
var Nil Instance
Nil is a nil/null instance of the class. Equivalent to the zero value.
func (Instance) AsRefCounted ¶
func (self Instance) AsRefCounted() [1]gd.RefCounted
func (Instance) AsResource ¶
func (Instance) AsStyleBox ¶
func (Instance) AsStyleBoxTexture ¶
func (Instance) AxisStretchHorizontal ¶
func (self Instance) AxisStretchHorizontal() AxisStretchMode
Controls how the stylebox's texture will be stretched or tiled horizontally.
func (Instance) AxisStretchVertical ¶
func (self Instance) AxisStretchVertical() AxisStretchMode
Controls how the stylebox's texture will be stretched or tiled vertically.
func (Instance) DrawCenter ¶
If true, the nine-patch texture's center tile will be drawn.
func (Instance) ExpandMarginBottom ¶
Expands the bottom margin of this style box when drawing, causing it to be drawn larger than requested.
func (Instance) ExpandMarginLeft ¶
Expands the left margin of this style box when drawing, causing it to be drawn larger than requested.
func (Instance) ExpandMarginRight ¶
Expands the right margin of this style box when drawing, causing it to be drawn larger than requested.
func (Instance) ExpandMarginTop ¶
Expands the top margin of this style box when drawing, causing it to be drawn larger than requested.
func (Instance) ModulateColor ¶
Modulates the color of the texture when this style box is drawn.
func (Instance) RegionRect ¶
func (self Instance) RegionRect() Rect2.PositionSize
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.
func (Instance) SetAxisStretchHorizontal ¶
func (self Instance) SetAxisStretchHorizontal(value AxisStretchMode)
SetAxisStretchHorizontal sets the property returned by [GetHAxisStretchMode].
func (Instance) SetAxisStretchVertical ¶
func (self Instance) SetAxisStretchVertical(value AxisStretchMode)
SetAxisStretchVertical sets the property returned by [GetVAxisStretchMode].
func (Instance) SetDrawCenter ¶
SetDrawCenter sets the property returned by [IsDrawCenterEnabled].
func (Instance) SetExpandMarginAll ¶
Sets the expand margin to 'size' pixels for all sides.
func (Instance) SetExpandMarginBottom ¶
SetExpandMarginBottom sets the property returned by [GetExpandMargin].
func (Instance) SetExpandMarginLeft ¶
SetExpandMarginLeft sets the property returned by [GetExpandMargin].
func (Instance) SetExpandMarginRight ¶
SetExpandMarginRight sets the property returned by [GetExpandMargin].
func (Instance) SetExpandMarginTop ¶
SetExpandMarginTop sets the property returned by [GetExpandMargin].
func (Instance) SetModulateColor ¶
SetModulateColor sets the property returned by [GetModulate].
func (Instance) SetRegionRect ¶
func (self Instance) SetRegionRect(value Rect2.PositionSize)
SetRegionRect sets the property returned by [GetRegionRect].
func (Instance) SetTexture ¶
SetTexture sets the property returned by [GetTexture].
func (Instance) SetTextureMarginAll ¶
Sets the margin to 'size' pixels for all sides.
func (Instance) SetTextureMarginBottom ¶
SetTextureMarginBottom sets the property returned by [GetTextureMargin].
func (Instance) SetTextureMarginLeft ¶
SetTextureMarginLeft sets the property returned by [GetTextureMargin].
func (Instance) SetTextureMarginRight ¶
SetTextureMarginRight sets the property returned by [GetTextureMargin].
func (Instance) SetTextureMarginTop ¶
SetTextureMarginTop sets the property returned by [GetTextureMargin].
func (Instance) 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 StyleBox.ContentMarginBottom if it is negative.
func (Instance) 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 StyleBox.ContentMarginLeft if it is negative.
func (Instance) 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 StyleBox.ContentMarginRight if it is negative.
func (Instance) 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 StyleBox.ContentMarginTop if it is negative.