-
Notifications
You must be signed in to change notification settings - Fork 0
StyleBox
Home | API by Category | Complete API Index | API Compatibility
| Field | Value |
|---|---|
| Full name | Electron2D.StyleBox |
| Namespace | Electron2D |
| Kind | class |
| Category | UI and Text |
Provides the base resource for drawing themed UI boxes.
public class Electron2D.StyleBox : Electron2D.ResourceStyleBox stores content margins and exposes a drawing hook used by
controls that resolve style box theme items.
The base implementation does not submit draw commands. Use
Electron2D.StyleBoxFlat when a rectangular background and borders are
needed.
This type is not synchronized. Create and mutate style boxes on the main scene thread.
This type is available since Electron2D 0.1.0 Preview.
Electron2D.StyleBoxFlatElectron2D.Theme
| Member | Kind | Summary |
|---|---|---|
ContentMarginBottom |
Property | Gets or sets the bottom content margin. |
ContentMarginLeft |
Property | Gets or sets the left content margin. |
ContentMarginRight |
Property | Gets or sets the right content margin. |
ContentMarginTop |
Property | Gets or sets the top content margin. |
Electron2D.StyleBox() |
Constructor | Initializes a new instance of the Electron2D.StyleBox class. |
Draw(Electron2D.CanvasItem, Electron2D.Rect2) |
Method | Draws this style box into a canvas item. |
GetMinimumSize() |
Method | Gets the minimum size contributed by content margins. |
Kind: Property
public System.Single ContentMarginBottom { get; set; }Gets or sets the bottom content margin.
Controls can use this margin when computing a minimum content area.
The bottom margin in UI units. The value must be finite and non-negative.
-
System.ArgumentOutOfRangeException: Thrown when the assigned value is negative or not finite.
This property is not synchronized. Mutate it on the main scene thread.
This property is available since Electron2D 0.1.0 Preview.
Electron2D.StyleBox.GetMinimumSize
Kind: Property
public System.Single ContentMarginLeft { get; set; }Gets or sets the left content margin.
Controls can use this margin when computing a minimum content area.
The left margin in UI units. The value must be finite and non-negative.
-
System.ArgumentOutOfRangeException: Thrown when the assigned value is negative or not finite.
This property is not synchronized. Mutate it on the main scene thread.
This property is available since Electron2D 0.1.0 Preview.
Electron2D.StyleBox.GetMinimumSize
Kind: Property
public System.Single ContentMarginRight { get; set; }Gets or sets the right content margin.
Controls can use this margin when computing a minimum content area.
The right margin in UI units. The value must be finite and non-negative.
-
System.ArgumentOutOfRangeException: Thrown when the assigned value is negative or not finite.
This property is not synchronized. Mutate it on the main scene thread.
This property is available since Electron2D 0.1.0 Preview.
Electron2D.StyleBox.GetMinimumSize
Kind: Property
public System.Single ContentMarginTop { get; set; }Gets or sets the top content margin.
Controls can use this margin when computing a minimum content area.
The top margin in UI units. The value must be finite and non-negative.
-
System.ArgumentOutOfRangeException: Thrown when the assigned value is negative or not finite.
This property is not synchronized. Mutate it on the main scene thread.
This property is available since Electron2D 0.1.0 Preview.
Electron2D.StyleBox.GetMinimumSize
Kind: Constructor
public Electron2D.StyleBox()Initializes a new instance of the Electron2D.StyleBox class.
The new style box starts with zero content margins and no drawing output.
This constructor is not synchronized. Call it from the main scene thread.
This constructor is available since Electron2D 0.1.0 Preview.
Electron2D.StyleBox
Kind: Method
public System.Void Draw(Electron2D.CanvasItem, Electron2D.Rect2)(Electron2D.CanvasItem canvasItem, Electron2D.Rect2 rect)Draws this style box into a canvas item.
The base implementation validates the input and submits no commands. Derived style boxes override this method to draw their visuals.
-
canvasItem: The canvas item that receives draw commands. -
rect: The local rectangle to draw into.
-
System.ArgumentNullException: Thrown whencanvasItemisnull. -
System.ArgumentOutOfRangeException: Thrown whenrectcontains non-finite components.
This method is not synchronized. Call it on the main scene thread.
This method is available since Electron2D 0.1.0 Preview.
Electron2D.CanvasItem.DrawRect(Electron2D.Rect2,Electron2D.Color,System.Boolean,System.Single,System.Boolean)
Kind: Method
public Electron2D.Vector2 GetMinimumSize()()Gets the minimum size contributed by content margins.
The base style box has no intrinsic graphic size beyond its margins.
The sum of horizontal and vertical content margins.
This method is not synchronized. Call it on the main scene thread.
This method is available since Electron2D 0.1.0 Preview.
Electron2D.StyleBox.ContentMarginLeftElectron2D.StyleBox.ContentMarginRight
Electron2D 0.1.0 Preview API reference. Generated from 175 public runtime types.