-
Notifications
You must be signed in to change notification settings - Fork 0
NinePatchRect
Home | API by Category | Complete API Index | API Compatibility
| Field | Value |
|---|---|
| Full name | Electron2D.NinePatchRect |
| Namespace | Electron2D |
| Kind | class |
| Category | UI and Text |
Provides a texture-backed UI rectangle with nine-patch margins.
public class Electron2D.NinePatchRect : Electron2D.ControlProfile: Electron2D 0.1.0 2D
Status: Supported / Parity verified
Out of profile: no
Godot reference: NinePatchRect
Texture-backed nine-patch control with source region, margins, optional center drawing and stretch/tile/tile-fit center axes.
NinePatchRect splits a source texture region into corner, edge and
center segments. Corners keep their margin sizes while edge and center
segments stretch or tile according to axis stretch settings.
This type is not synchronized. Create and mutate nine-patch rectangles on the main scene thread.
This type is available since Electron2D 0.1.0 Preview.
Electron2D.Texture2DElectron2D.TextureRect
| Member | Kind | Summary |
|---|---|---|
AxisStretchHorizontal |
Property | Gets or sets horizontal center stretch behavior. |
AxisStretchVertical |
Property | Gets or sets vertical center stretch behavior. |
DrawCenter |
Property | Gets or sets whether the center segment is drawn. |
PatchMarginBottom |
Property | Gets or sets the bottom patch margin in pixels. |
PatchMarginLeft |
Property | Gets or sets the left patch margin in pixels. |
PatchMarginRight |
Property | Gets or sets the right patch margin in pixels. |
PatchMarginTop |
Property | Gets or sets the top patch margin in pixels. |
RegionRect |
Property | Gets or sets the source region inside Electron2D.NinePatchRect.Texture. |
Texture |
Property | Gets or sets the texture drawn by this control. |
Electron2D.NinePatchRect() |
Constructor | Initializes a new instance of the Electron2D.NinePatchRect class. |
_Draw() |
Method | Draws the nine-patch texture segments. |
_GetMinimumSize() |
Method | Gets the minimum size requested by this nine-patch rectangle. |
Kind: Property
public Electron2D.NinePatchRect.AxisStretchModeEnum AxisStretchHorizontal { get; set; }Gets or sets horizontal center stretch behavior.
The default is Electron2D.NinePatchRect.AxisStretchModeEnum.Stretch.
The mode used for the center column.
This property is not synchronized. Mutate it on the main scene thread.
This property is available since Electron2D 0.1.0 Preview.
Electron2D.NinePatchRect.AxisStretchModeEnum
Kind: Property
public Electron2D.NinePatchRect.AxisStretchModeEnum AxisStretchVertical { get; set; }Gets or sets vertical center stretch behavior.
The default is Electron2D.NinePatchRect.AxisStretchModeEnum.Stretch.
The mode used for the center row.
This property is not synchronized. Mutate it on the main scene thread.
This property is available since Electron2D 0.1.0 Preview.
Electron2D.NinePatchRect.AxisStretchModeEnum
Kind: Property
public System.Boolean DrawCenter { get; set; }Gets or sets whether the center segment is drawn.
Edges and corners are still drawn when this property is false.
true to draw the center segment; otherwise, false.
This property is not synchronized. Mutate it on the main scene thread.
This property is available since Electron2D 0.1.0 Preview.
Electron2D.NinePatchRect
Kind: Property
public System.Int32 PatchMarginBottom { get; set; }Gets or sets the bottom patch margin in pixels.
The margin is clamped to available source and destination size during drawing.
A non-negative margin.
-
System.ArgumentOutOfRangeException: Thrown when the assigned value is negative.
This property is not synchronized. Mutate it on the main scene thread.
This property is available since Electron2D 0.1.0 Preview.
Electron2D.NinePatchRect.PatchMarginTop
Kind: Property
public System.Int32 PatchMarginLeft { get; set; }Gets or sets the left patch margin in pixels.
The margin is clamped to available source and destination size during drawing.
A non-negative margin.
-
System.ArgumentOutOfRangeException: Thrown when the assigned value is negative.
This property is not synchronized. Mutate it on the main scene thread.
This property is available since Electron2D 0.1.0 Preview.
Electron2D.NinePatchRect.PatchMarginRight
Kind: Property
public System.Int32 PatchMarginRight { get; set; }Gets or sets the right patch margin in pixels.
The margin is clamped to available source and destination size during drawing.
A non-negative margin.
-
System.ArgumentOutOfRangeException: Thrown when the assigned value is negative.
This property is not synchronized. Mutate it on the main scene thread.
This property is available since Electron2D 0.1.0 Preview.
Electron2D.NinePatchRect.PatchMarginLeft
Kind: Property
public System.Int32 PatchMarginTop { get; set; }Gets or sets the top patch margin in pixels.
The margin is clamped to available source and destination size during drawing.
A non-negative margin.
-
System.ArgumentOutOfRangeException: Thrown when the assigned value is negative.
This property is not synchronized. Mutate it on the main scene thread.
This property is available since Electron2D 0.1.0 Preview.
Electron2D.NinePatchRect.PatchMarginBottom
Kind: Property
public Electron2D.Rect2 RegionRect { get; set; }Gets or sets the source region inside Electron2D.NinePatchRect.Texture.
Negative size components are rejected.
A source rectangle in texture pixels, or an empty rectangle to use the full texture.
-
System.ArgumentOutOfRangeException: Thrown when the rectangle is not finite or has negative size.
This property is not synchronized. Mutate it on the main scene thread.
This property is available since Electron2D 0.1.0 Preview.
Electron2D.NinePatchRect.Texture
Kind: Property
public Electron2D.Texture2D Texture { get; set; }Gets or sets the texture drawn by this control.
Assigning this property queues a redraw.
The texture resource, or null to draw nothing.
This property is not synchronized. Mutate it on the main scene thread.
This property is available since Electron2D 0.1.0 Preview.
Electron2D.Texture2D
Kind: Constructor
public Electron2D.NinePatchRect()Initializes a new instance of the Electron2D.NinePatchRect class.
The new control draws its center segment by default.
This constructor is not synchronized. Call it from the main scene thread.
This constructor is available since Electron2D 0.1.0 Preview.
Electron2D.NinePatchRect
Kind: Method
public System.Void _Draw()()Draws the nine-patch texture segments.
No draw command is submitted when Electron2D.NinePatchRect.Texture is null.
This callback is invoked on the main scene thread.
This method is available since Electron2D 0.1.0 Preview.
Electron2D.NinePatchRect.Texture
Kind: Method
public Electron2D.Vector2 _GetMinimumSize()()Gets the minimum size requested by this nine-patch rectangle.
The value is independent of Electron2D.NinePatchRect.Texture.
The sum of horizontal and vertical patch margins.
This callback is invoked on the main scene thread.
This method is available since Electron2D 0.1.0 Preview.
Electron2D.NinePatchRect.PatchMarginLeft
Electron2D 0.1.0 Preview API reference. Generated from 175 public runtime types.