Class NinePatchRect
- Namespace
- Forma
- Assembly
- Forma.dll
Draws a texture as nine patches so configured borders remain stable while center and edge regions stretch or tile.
public class NinePatchRect : TextureRect, IAddChild<Control>, IAddChild, INotifyPropertyChanged
- Inheritance
-
NinePatchRect
- Implements
- Derived
- Inherited Members
Constructors
NinePatchRect()
public NinePatchRect()
Properties
DrawCenter
public bool DrawCenter { get; set; }
Property Value
HorizontalAxisStretchMode
public NinePatchAxisStretchMode HorizontalAxisStretchMode { get; set; }
Property Value
PatchMargin
public Thickness PatchMargin { get; set; }
Property Value
RegionRect
Optional source region. An empty region uses the entire texture.
public Rectangle RegionRect { get; set; }
Property Value
- Rectangle
SamplingMode
public ImageSamplingMode SamplingMode { get; set; }
Property Value
VerticalAxisStretchMode
public NinePatchAxisStretchMode VerticalAxisStretchMode { get; set; }
Property Value
Methods
GetHAxisStretchMode()
public NinePatchAxisStretchMode GetHAxisStretchMode()
Returns
GetMinimumSize()
public override Vector2 GetMinimumSize()
Returns
- Vector2
GetPatchMargin(Side)
public float GetPatchMargin(Side side)
Parameters
sideSide
Returns
GetPatchMargins()
public Thickness GetPatchMargins()
Returns
GetRegionRect()
public Rectangle GetRegionRect()
Returns
- Rectangle
GetSourceRegion(Vector2)
Resolves the source region used by this nine-patch against a texture size.
public Rectangle GetSourceRegion(Vector2 textureSize)
Parameters
textureSizeVector2
Returns
- Rectangle
GetVAxisStretchMode()
public NinePatchAxisStretchMode GetVAxisStretchMode()
Returns
IsDrawCenterEnabled()
public bool IsDrawCenterEnabled()
Returns
OnTextureChanged()
Hook for a subclass-specific texture_changed signal (only NinePatchRect has one in Godot).
protected override void OnTextureChanged()
SetDrawCenter(bool)
public void SetDrawCenter(bool enabled)
Parameters
enabledbool
SetHAxisStretchMode(NinePatchAxisStretchMode)
public void SetHAxisStretchMode(NinePatchAxisStretchMode mode)
Parameters
SetPatchMargin(Side, float)
public void SetPatchMargin(Side side, float value)
Parameters
SetPatchMargins(Thickness)
public void SetPatchMargins(Thickness margins)
Parameters
marginsThickness
SetRegionRect(Rectangle)
public void SetRegionRect(Rectangle rect)
Parameters
rectRectangle
SetVAxisStretchMode(NinePatchAxisStretchMode)
public void SetVAxisStretchMode(NinePatchAxisStretchMode mode)
Parameters
Events
TextureChanged
Matches Godot's NinePatchRect-only texture_changed signal.
public event Action<NinePatchRect, Texture2D> TextureChanged
Event Type
- Action<NinePatchRect, Texture2D>