-
Notifications
You must be signed in to change notification settings - Fork 0
Control
Namespace: Electron2D
Provides the Electron2D base node for 2D user interface controls.
public class Electron2D.Control : Electron2D.CanvasItemControl inherits from Electron2D.CanvasItem and adds a rectangular UI
area plus minimal theme font overrides used by Electron2D.Label in
Electron2D 0.1.0 Preview. Anchors, containers, focus and input filtering are
planned UI tasks and are not implemented by this baseline.
This type is not synchronized. Create and mutate controls on the main scene thread.
This type is available since Electron2D 0.1.0 Preview.
Electron2D.CanvasItemElectron2D.Label
| Member | Kind | Summary |
|---|---|---|
Position |
Property | Gets or sets the local position of this control. |
Size |
Property | Gets or sets the local size of this control. |
Electron2D.Control() |
Constructor | Initializes a new instance of the Control type. |
AddThemeFontOverride(System.String, Electron2D.Font) |
Method | Adds or replaces a font theme override for this control. |
AddThemeFontSizeOverride(System.String, System.Int32) |
Method | Adds or replaces a font size theme override for this control. |
GetThemeFont(System.String) |
Method | Gets a font theme override by name. |
GetThemeFontSize(System.String) |
Method | Gets a font size theme override by name. |
Kind: Property
public Electron2D.Vector2 Position { get; set; }Gets or sets the local position of this control.
This property follows the validation and lifetime rules of its declaring type.
The current position value.
This property is not synchronized. Mutate it on the main scene thread.
This property is available since Electron2D 0.1.0 Preview.
Electron2D.Control
Kind: Property
public Electron2D.Vector2 Size { get; set; }Gets or sets the local size of this control.
This property follows the validation and lifetime rules of its declaring type.
The current size value.
This property is not synchronized. Mutate it on the main scene thread.
This property is available since Electron2D 0.1.0 Preview.
Electron2D.Control
Kind: Constructor
public Electron2D.Control()Initializes a new instance of the Control type.
The new instance follows the lifetime and validation rules of its declaring type.
This member is not synchronized. Call it from the thread that owns the related object unless the declaring type states otherwise.
This API is available since Electron2D 0.1.0 Preview.
Electron2D.Control
Kind: Method
public System.Void AddThemeFontOverride(System.String, Electron2D.Font)(System.String name, Electron2D.Font font)Adds or replaces a font theme override for this control.
This method follows the validation and lifetime rules of its declaring type.
-
name: The theme font name, for examplefont. -
font: The font resource to use.
-
System.ArgumentException: Thrown whennameisnull, empty or whitespace. -
System.ArgumentNullException: Thrown whenfontisnull.
This method is not synchronized. Call it on the main scene thread.
This method is available since Electron2D 0.1.0 Preview.
Electron2D.Control
Kind: Method
public System.Void AddThemeFontSizeOverride(System.String, System.Int32)(System.String name, System.Int32 fontSize)Adds or replaces a font size theme override for this control.
This method follows the validation and lifetime rules of its declaring type.
-
name: The theme font size name, for examplefont_size. -
fontSize: The font size in pixels. It must be greater than zero.
-
System.ArgumentException: Thrown whennameisnull, empty or whitespace. -
System.ArgumentOutOfRangeException: Thrown whenfontSizeis less than or equal to zero.
This method is not synchronized. Call it on the main scene thread.
This method is available since Electron2D 0.1.0 Preview.
Electron2D.Control
Kind: Method
public Electron2D.Font GetThemeFont(System.String)(System.String name)Gets a font theme override by name.
This method follows the validation and lifetime rules of its declaring type.
-
name: The theme font name.
The overridden font, or null when no override exists.
-
System.ArgumentException: Thrown whennameisnull, empty or whitespace.
This method is not synchronized. Call it on the main scene thread.
This method is available since Electron2D 0.1.0 Preview.
Electron2D.Control
Kind: Method
public System.Int32 GetThemeFontSize(System.String)(System.String name)Gets a font size theme override by name.
This method follows the validation and lifetime rules of its declaring type.
-
name: The theme font size name.
The overridden font size in pixels, or 16 when no override exists.
-
System.ArgumentException: Thrown whennameisnull, empty or whitespace.
This method is not synchronized. Call it on the main scene thread.
This method is available since Electron2D 0.1.0 Preview.
Electron2D.Control
Electron2D 0.1.0 Preview API reference. Generated from 175 public runtime types.