-
Notifications
You must be signed in to change notification settings - Fork 0
Control
Home | API by Category | Complete API Index | API Compatibility
| Field | Value |
|---|---|
| Full name | Electron2D.Control |
| Namespace | Electron2D |
| Kind | class |
| Category | UI and Text |
Provides the Electron2D base node for 2D user interface controls.
public class Electron2D.Control : Electron2D.CanvasItemProfile: Electron2D 0.1.0 2D
Status: Supported / Parity verified
Out of profile: no
Godot reference: Control
UI base node with anchors, offsets, computed rect, minimum size, size flags, grow direction, clipping hit-test, theme inheritance, local theme overrides, high-DPI scaling, tooltip hooks, _GuiInput, MouseFilter, FocusMode, event acceptance and focus helpers.
Control inherits from Electron2D.CanvasItem and adds a rectangular
UI area, theme font overrides, GUI input callbacks, mouse filtering and
focus ownership used by Electron2D UI nodes.
Anchors, offsets, minimum-size clamping, focus navigation and the baseline input pipeline are available in this preview. Containers and full widgets are implemented by later UI tasks.
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 |
|---|---|---|
AnchorBottom |
Property | Gets or sets the bottom anchor of this control. |
AnchorLeft |
Property | Gets or sets the left anchor of this control. |
AnchorRight |
Property | Gets or sets the right anchor of this control. |
AnchorTop |
Property | Gets or sets the top anchor of this control. |
ClipContents |
Property | Gets or sets whether this control clips GUI hit-testing for its descendants. |
CustomMinimumSize |
Property | Gets or sets the custom minimum size of this control. |
FocusMode |
Property | Gets or sets how this control can receive focus. |
FocusNeighborBottom |
Property | Gets or sets the explicit focus target used for bottom-direction navigation. |
FocusNeighborLeft |
Property | Gets or sets the explicit focus target used for left-direction navigation. |
FocusNeighborRight |
Property | Gets or sets the explicit focus target used for right-direction navigation. |
FocusNeighborTop |
Property | Gets or sets the explicit focus target used for top-direction navigation. |
FocusNext |
Property | Gets or sets the explicit focus target used when navigating to the next control. |
FocusPrevious |
Property | Gets or sets the explicit focus target used when navigating to the previous control. |
GrowHorizontal |
Property | Gets or sets the horizontal grow direction used when minimum size expands this control. |
GrowVertical |
Property | Gets or sets the vertical grow direction used when minimum size expands this control. |
MouseFilter |
Property | Gets or sets how this control receives and consumes mouse input. |
OffsetBottom |
Property | Gets or sets the bottom offset of this control. |
OffsetLeft |
Property | Gets or sets the left offset of this control. |
OffsetRight |
Property | Gets or sets the right offset of this control. |
OffsetTop |
Property | Gets or sets the top offset of this control. |
Position |
Property | Gets or sets the local position of this control. |
Size |
Property | Gets or sets the local size of this control. |
SizeFlagsHorizontal |
Property | Gets or sets the horizontal size flags used by a parent Electron2D.Container. |
SizeFlagsStretchRatio |
Property | Gets or sets the expansion weight used by a parent Electron2D.Container. |
SizeFlagsVertical |
Property | Gets or sets the vertical size flags used by a parent Electron2D.Container. |
Theme |
Property | Gets or sets the theme resource applied to this control branch. |
ThemeTypeVariation |
Property | Gets or sets the theme type variation used before this control type. |
TooltipText |
Property | Gets or sets the default tooltip text for this control. |
Electron2D.Control() |
Constructor | Initializes a new instance of the Control type. |
AcceptEvent() |
Method | Marks the current GUI input event as handled. |
AddThemeColorOverride(System.String, Electron2D.Color) |
Method | Adds or replaces a color theme override for this control. |
AddThemeConstantOverride(System.String, System.Int32) |
Method | Adds or replaces an integer theme constant override for this control. |
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. |
AddThemeIconOverride(System.String, Electron2D.Texture2D) |
Method | Adds or replaces an icon theme override for this control. |
AddThemeStyleBoxOverride(System.String, Electron2D.StyleBox) |
Method | Adds or replaces a style box theme override for this control. |
FindNextValidFocus() |
Method | Finds the next focusable control in this viewport. |
FindPrevValidFocus() |
Method | Finds the previous focusable control in this viewport. |
GetCombinedMinimumSize() |
Method | Gets the minimum size used by layout calculations. |
GetGlobalRect() |
Method | Gets the rectangle occupied by this control in root viewport coordinates. |
GetMinimumSize() |
Method | Gets the minimum size requested by this control. |
GetRect() |
Method | Gets the local rectangle occupied by this control. |
GetThemeColor(System.String, System.String) |
Method | Gets a color from local overrides or inherited themes. |
GetThemeConstant(System.String, System.String) |
Method | Gets an integer theme constant override by name. |
GetThemeDefaultBaseScale() |
Method | Gets the resolved theme base scale. |
GetThemeDefaultFont() |
Method | Gets the resolved default theme font. |
GetThemeDefaultFontSize() |
Method | Gets the resolved default theme font size. |
GetThemeFont(System.String, System.String) |
Method | Gets a font from local overrides, inherited themes or the default theme font. |
GetThemeFontSize(System.String, System.String) |
Method | Gets a scaled font size from local overrides, inherited themes or fallback values. |
GetThemeIcon(System.String, System.String) |
Method | Gets an icon from local overrides or inherited themes. |
GetThemeStyleBox(System.String, System.String) |
Method | Gets a style box from local overrides or inherited themes. |
GetTooltip(Electron2D.Vector2) |
Method | Gets tooltip text for a local pointer position. |
GrabFocus() |
Method | Gives keyboard and gamepad focus to this control. |
HasFocus() |
Method | Checks whether this control currently owns focus in its viewport. |
HasThemeColor(System.String, System.String) |
Method | Reports whether a color can be resolved. |
HasThemeColorOverride(System.String) |
Method | Reports whether this control has a local color override. |
HasThemeConstant(System.String, System.String) |
Method | Reports whether a constant can be resolved. |
HasThemeConstantOverride(System.String) |
Method | Reports whether this control has a theme constant override by name. |
HasThemeFontOverride(System.String) |
Method | Reports whether this control has a local font override. |
HasThemeFontSizeOverride(System.String) |
Method | Reports whether this control has a local font size override. |
HasThemeIcon(System.String, System.String) |
Method | Reports whether an icon can be resolved. |
HasThemeIconOverride(System.String) |
Method | Reports whether this control has a local icon override. |
HasThemeStyleBox(System.String, System.String) |
Method | Reports whether a style box can be resolved. |
HasThemeStyleBoxOverride(System.String) |
Method | Reports whether this control has a local style box override. |
ReleaseFocus() |
Method | Releases focus from this control when it currently owns it. |
RemoveThemeColorOverride(System.String) |
Method | Removes a color theme override from this control. |
RemoveThemeConstantOverride(System.String) |
Method | Removes a constant theme override from this control. |
RemoveThemeFontOverride(System.String) |
Method | Removes a font theme override from this control. |
RemoveThemeFontSizeOverride(System.String) |
Method | Removes a font size theme override from this control. |
RemoveThemeIconOverride(System.String) |
Method | Removes an icon theme override from this control. |
RemoveThemeStyleBoxOverride(System.String) |
Method | Removes a style box theme override from this control. |
ResetSize() |
Method | Resets this control size to its combined minimum size. |
SetSize(Electron2D.Vector2) |
Method | Sets the computed size of this control. |
_GetMinimumSize() |
Method | Called to compute the control-specific minimum size. |
_GetTooltip(Electron2D.Vector2) |
Method | Called to resolve tooltip text for a local pointer position. |
_GuiInput(Electron2D.InputEvent) |
Method | Called when a GUI input event is delivered to this control. |
_MakeCustomTooltip(System.String) |
Method | Called to create a custom tooltip control for resolved text. |
Kind: Property
public System.Single AnchorBottom { get; set; }Gets or sets the bottom anchor of this control.
The final bottom edge is calculated as the parent layout height
multiplied by this value, plus Electron2D.Control.OffsetBottom.
The bottom anchor as a fraction of the parent layout size.
This property is not synchronized. Mutate it on the main scene thread.
This property is available since Electron2D 0.1.0 Preview.
Electron2D.Control.AnchorTopElectron2D.Control.OffsetBottom
Kind: Property
public System.Single AnchorLeft { get; set; }Gets or sets the left anchor of this control.
The final left edge is calculated as the parent layout width multiplied
by this value, plus Electron2D.Control.OffsetLeft.
The left anchor as a fraction of the parent layout size.
This property is not synchronized. Mutate it on the main scene thread.
This property is available since Electron2D 0.1.0 Preview.
Electron2D.Control.AnchorRightElectron2D.Control.OffsetLeft
Kind: Property
public System.Single AnchorRight { get; set; }Gets or sets the right anchor of this control.
The final right edge is calculated as the parent layout width multiplied
by this value, plus Electron2D.Control.OffsetRight.
The right anchor as a fraction of the parent layout size.
This property is not synchronized. Mutate it on the main scene thread.
This property is available since Electron2D 0.1.0 Preview.
Electron2D.Control.AnchorLeftElectron2D.Control.OffsetRight
Kind: Property
public System.Single AnchorTop { get; set; }Gets or sets the top anchor of this control.
The final top edge is calculated as the parent layout height multiplied
by this value, plus Electron2D.Control.OffsetTop.
The top anchor as a fraction of the parent layout size.
This property is not synchronized. Mutate it on the main scene thread.
This property is available since Electron2D 0.1.0 Preview.
Electron2D.Control.AnchorBottomElectron2D.Control.OffsetTop
Kind: Property
public System.Boolean ClipContents { get; set; }Gets or sets whether this control clips GUI hit-testing for its descendants.
The 0.1.0 Preview baseline applies this flag to mouse and touch dispatch. Renderer scissor integration is handled by later rendering backend work.
true to prevent descendants from receiving pointer input outside
this control's global rectangle; 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.Control.GetGlobalRectElectron2D.Control.MouseFilter
Kind: Property
public Electron2D.Vector2 CustomMinimumSize { get; set; }Gets or sets the custom minimum size of this control.
This value is combined with Electron2D.Control._GetMinimumSize by
Electron2D.Control.GetMinimumSize.
The user-defined minimum size. Components must be finite and non-negative.
-
System.ArgumentOutOfRangeException: Thrown when a component 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.Control.GetCombinedMinimumSizeElectron2D.Control._GetMinimumSize
Kind: Property
public Electron2D.FocusMode FocusMode { get; set; }Gets or sets how this control can receive focus.
Focus is owned by the nearest Electron2D.Viewport. Only one visible
control inside that viewport can report Electron2D.Control.HasFocus at a
time.
Electron2D.FocusMode.Click and
Electron2D.FocusMode.All allow mouse press events to focus
this control before Electron2D.Control._GuiInput(Electron2D.InputEvent) is called.
The current Electron2D.FocusMode value. The default is
Electron2D.FocusMode.None.
This property is not synchronized. Mutate it on the main scene thread.
This property is available since Electron2D 0.1.0 Preview.
Electron2D.Control.FocusModeElectron2D.Control.GrabFocusElectron2D.Control.HasFocus
Kind: Property
public Electron2D.NodePath FocusNeighborBottom { get; set; }Gets or sets the explicit focus target used for bottom-direction navigation.
Directional focus paths are used by the viewport keyboard navigation baseline when arrow-key navigation is requested.
A Electron2D.NodePath resolved from this control. The default value is
an empty path.
This property is not synchronized. Mutate it on the main scene thread.
This property is available since Electron2D 0.1.0 Preview.
Electron2D.Control.FocusNeighborTop
Kind: Property
public Electron2D.NodePath FocusNeighborLeft { get; set; }Gets or sets the explicit focus target used for left-direction navigation.
Directional focus paths are used by the viewport keyboard navigation baseline when arrow-key navigation is requested.
A Electron2D.NodePath resolved from this control. The default value is
an empty path.
This property is not synchronized. Mutate it on the main scene thread.
This property is available since Electron2D 0.1.0 Preview.
Electron2D.Control.FocusNeighborRight
Kind: Property
public Electron2D.NodePath FocusNeighborRight { get; set; }Gets or sets the explicit focus target used for right-direction navigation.
Directional focus paths are used by the viewport keyboard navigation baseline when arrow-key navigation is requested.
A Electron2D.NodePath resolved from this control. The default value is
an empty path.
This property is not synchronized. Mutate it on the main scene thread.
This property is available since Electron2D 0.1.0 Preview.
Electron2D.Control.FocusNeighborLeft
Kind: Property
public Electron2D.NodePath FocusNeighborTop { get; set; }Gets or sets the explicit focus target used for top-direction navigation.
Directional focus paths are used by the viewport keyboard navigation baseline when arrow-key navigation is requested.
A Electron2D.NodePath resolved from this control. The default value is
an empty path.
This property is not synchronized. Mutate it on the main scene thread.
This property is available since Electron2D 0.1.0 Preview.
Electron2D.Control.FocusNeighborBottom
Kind: Property
public Electron2D.NodePath FocusNext { get; set; }Gets or sets the explicit focus target used when navigating to the next control.
Electron2D.Control.FindNextValidFocus uses this path before falling back to
viewport tree order.
A Electron2D.NodePath resolved from this control. The default value is
an empty path.
This property is not synchronized. Mutate it on the main scene thread.
This property is available since Electron2D 0.1.0 Preview.
Electron2D.Control.FindNextValidFocusElectron2D.Control.FocusPrevious
Kind: Property
public Electron2D.NodePath FocusPrevious { get; set; }Gets or sets the explicit focus target used when navigating to the previous control.
Electron2D.Control.FindPrevValidFocus uses this path before falling back to
viewport tree order.
A Electron2D.NodePath resolved from this control. The default value is
an empty path.
This property is not synchronized. Mutate it on the main scene thread.
This property is available since Electron2D 0.1.0 Preview.
Electron2D.Control.FindPrevValidFocusElectron2D.Control.FocusNext
Kind: Property
public Electron2D.GrowDirection GrowHorizontal { get; set; }Gets or sets the horizontal grow direction used when minimum size expands this control.
This value is used by Electron2D.Control.SetSize(Electron2D.Vector2) and
Electron2D.Control.ResetSize when the requested width is smaller than the
minimum width.
The horizontal Electron2D.GrowDirection. The default is
Electron2D.GrowDirection.End.
This property is not synchronized. Mutate it on the main scene thread.
This property is available since Electron2D 0.1.0 Preview.
Electron2D.Control.GrowVerticalElectron2D.GrowDirection
Kind: Property
public Electron2D.GrowDirection GrowVertical { get; set; }Gets or sets the vertical grow direction used when minimum size expands this control.
This value is used by Electron2D.Control.SetSize(Electron2D.Vector2) and
Electron2D.Control.ResetSize when the requested height is smaller than the
minimum height.
The vertical Electron2D.GrowDirection. The default is
Electron2D.GrowDirection.End.
This property is not synchronized. Mutate it on the main scene thread.
This property is available since Electron2D 0.1.0 Preview.
Electron2D.Control.GrowHorizontalElectron2D.GrowDirection
Kind: Property
public Electron2D.MouseFilter MouseFilter { get; set; }Gets or sets how this control receives and consumes mouse input.
The root Electron2D.Viewport reads this property while routing
Electron2D.InputEventMouse events to Electron2D.Control._GuiInput(Electron2D.InputEvent).
Electron2D.MouseFilter.Stop handles the event after this control
receives it. Electron2D.MouseFilter.Pass lets unhandled events bubble
to the parent control. Electron2D.MouseFilter.Ignore skips this
control for mouse hit-testing.
The current Electron2D.Control.MouseFilter value. The default is
Electron2D.MouseFilter.Stop.
This property is not synchronized. Mutate it on the main scene thread.
This property is available since Electron2D 0.1.0 Preview.
Electron2D.Control.MouseFilterElectron2D.Control._GuiInput(Electron2D.InputEvent)
Kind: Property
public System.Single OffsetBottom { get; set; }Gets or sets the bottom offset of this control.
The bottom offset can be negative when the bottom edge should stay inset from the parent layout rectangle.
The pixel offset applied to Electron2D.Control.AnchorBottom.
This property is not synchronized. Mutate it on the main scene thread.
This property is available since Electron2D 0.1.0 Preview.
Electron2D.Control.AnchorBottomElectron2D.Control.OffsetTop
Kind: Property
public System.Single OffsetLeft { get; set; }Gets or sets the left offset of this control.
Offsets are expressed in the local coordinate space of the parent layout rectangle.
The pixel offset applied to Electron2D.Control.AnchorLeft.
This property is not synchronized. Mutate it on the main scene thread.
This property is available since Electron2D 0.1.0 Preview.
Electron2D.Control.AnchorLeftElectron2D.Control.OffsetRight
Kind: Property
public System.Single OffsetRight { get; set; }Gets or sets the right offset of this control.
The right offset can be negative when the right edge should stay inset from the parent layout rectangle.
The pixel offset applied to Electron2D.Control.AnchorRight.
This property is not synchronized. Mutate it on the main scene thread.
This property is available since Electron2D 0.1.0 Preview.
Electron2D.Control.AnchorRightElectron2D.Control.OffsetLeft
Kind: Property
public System.Single OffsetTop { get; set; }Gets or sets the top offset of this control.
Offsets are expressed in the local coordinate space of the parent layout rectangle.
The pixel offset applied to Electron2D.Control.AnchorTop.
This property is not synchronized. Mutate it on the main scene thread.
This property is available since Electron2D 0.1.0 Preview.
Electron2D.Control.AnchorTopElectron2D.Control.OffsetBottom
Kind: Property
public Electron2D.Vector2 Position { get; set; }Gets or sets the local position of this control.
Setting this property updates offsets while preserving anchors and the
current computed Electron2D.Control.Size.
The top-left corner of the computed local rectangle.
This property is not synchronized. Mutate it on the main scene thread.
This property is available since Electron2D 0.1.0 Preview.
Electron2D.Control.GetGlobalRectElectron2D.Control.GetRect
Kind: Property
public Electron2D.Vector2 Size { get; set; }Gets or sets the local size of this control.
Setting this property is equivalent to calling
Electron2D.Control.SetSize(Electron2D.Vector2).
The computed local rectangle size.
This property is not synchronized. Mutate it on the main scene thread.
This property is available since Electron2D 0.1.0 Preview.
Electron2D.Control.GetCombinedMinimumSizeElectron2D.Control.SetSize(Electron2D.Vector2)
Kind: Property
public Electron2D.SizeFlags SizeFlagsHorizontal { get; set; }Gets or sets the horizontal size flags used by a parent Electron2D.Container.
This property is read by layout containers only. It does not change this control's rectangle until a parent container performs layout.
A Electron2D.SizeFlags value that describes how this control should
use horizontal space allocated by a container.
This property is not synchronized. Mutate it on the main scene thread.
This property is available since Electron2D 0.1.0 Preview.
Electron2D.ContainerElectron2D.Control.SizeFlagsStretchRatioElectron2D.Control.SizeFlagsVertical
Kind: Property
public System.Single SizeFlagsStretchRatio { get; set; }Gets or sets the expansion weight used by a parent Electron2D.Container.
The value is considered only when the relevant size flag contains
Electron2D.SizeFlags.Expand or Electron2D.SizeFlags.ExpandFill.
The positive finite ratio used when a container distributes free space between expanding children.
-
System.ArgumentOutOfRangeException: Thrown when the value is not finite or is less than or equal to zero.
This property is not synchronized. Mutate it on the main scene thread.
This property is available since Electron2D 0.1.0 Preview.
Electron2D.Control.SizeFlagsHorizontalElectron2D.Control.SizeFlagsVertical
Kind: Property
public Electron2D.SizeFlags SizeFlagsVertical { get; set; }Gets or sets the vertical size flags used by a parent Electron2D.Container.
This property is read by layout containers only. It does not change this control's rectangle until a parent container performs layout.
A Electron2D.SizeFlags value that describes how this control should
use vertical space allocated by a container.
This property is not synchronized. Mutate it on the main scene thread.
This property is available since Electron2D 0.1.0 Preview.
Electron2D.ContainerElectron2D.Control.SizeFlagsHorizontalElectron2D.Control.SizeFlagsStretchRatio
Kind: Property
public Electron2D.Theme Theme { get; set; }Gets or sets the theme resource applied to this control branch.
A theme assigned to a control is used by that control and by descendant controls while the parent chain remains made of controls.
The theme resource assigned to this control, or null when this
control should inherit a theme from its parent controls.
This property is not synchronized. Mutate it on the main scene thread.
This property is available since Electron2D 0.1.0 Preview.
Electron2D.Control.GetThemeColor(System.String,System.String)Electron2D.Control.Theme
Kind: Property
public System.String ThemeTypeVariation { get; set; }Gets or sets the theme type variation used before this control type.
A non-empty value gives a theme a way to style one control differently from other controls of the same runtime type.
The variation name, or an empty string when no variation is used.
This property is not synchronized. Mutate it on the main scene thread.
This property is available since Electron2D 0.1.0 Preview.
Electron2D.Control.Theme
Kind: Property
public System.String TooltipText { get; set; }Gets or sets the default tooltip text for this control.
Override Electron2D.Control._GetTooltip(Electron2D.Vector2) when the text depends on
the pointer position.
The tooltip text. A null assignment is normalized to an empty
string.
This property is not synchronized. Mutate it on the main scene thread.
This property is available since Electron2D 0.1.0 Preview.
Electron2D.Control.GetTooltip(Electron2D.Vector2)
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 AcceptEvent()()Marks the current GUI input event as handled.
This method forwards to Electron2D.Viewport.SetInputAsHandled on the
containing viewport. It has no effect when this control is outside a
scene tree or when no input event is currently being dispatched.
This method is not synchronized. Call it on the main scene thread while
handling Electron2D.Control._GuiInput(Electron2D.InputEvent).
This method is available since Electron2D 0.1.0 Preview.
Electron2D.Control._GuiInput(Electron2D.InputEvent)Electron2D.Viewport.SetInputAsHandled
Kind: Method
public System.Void AddThemeColorOverride(System.String, Electron2D.Color)(System.String name, Electron2D.Color color)Adds or replaces a color theme override for this control.
Local overrides have priority over assigned theme resources.
-
name: The theme color name. -
color: The color value to use.
-
System.ArgumentException: Thrown whennameis empty.
This method is not synchronized. Call it on the main scene thread.
This method is available since Electron2D 0.1.0 Preview.
Electron2D.Control.GetThemeColor(System.String,System.String)
Kind: Method
public System.Void AddThemeConstantOverride(System.String, System.Int32)(System.String name, System.Int32 constant)Adds or replaces an integer theme constant override for this control.
The 0.1.0 Preview UI containers use this baseline for spacing and margins before full theme resources are introduced.
-
name: The theme constant name, for exampleseparationormargin_left. -
constant: The non-negative constant value in pixels.
-
System.ArgumentException: Thrown whennameisnull, empty or whitespace. -
System.ArgumentOutOfRangeException: Thrown whenconstantis less than zero.
This method is not synchronized. Call it on the main scene thread.
This method is available since Electron2D 0.1.0 Preview.
Electron2D.ContainerElectron2D.Control.GetThemeConstant(System.String,System.String)Electron2D.Control.HasThemeConstantOverride(System.String)
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 System.Void AddThemeIconOverride(System.String, Electron2D.Texture2D)(System.String name, Electron2D.Texture2D icon)Adds or replaces an icon theme override for this control.
Local overrides have priority over assigned theme resources.
-
name: The theme icon name. -
icon: The texture resource to use.
-
System.ArgumentException: Thrown whennameis empty. -
System.ArgumentNullException: Thrown wheniconisnull.
This method is not synchronized. Call it on the main scene thread.
This method is available since Electron2D 0.1.0 Preview.
Electron2D.Control.GetThemeIcon(System.String,System.String)
Kind: Method
public System.Void AddThemeStyleBoxOverride(System.String, Electron2D.StyleBox)(System.String name, Electron2D.StyleBox styleBox)Adds or replaces a style box theme override for this control.
Local overrides have priority over assigned theme resources.
-
name: The theme style box name. -
styleBox: The style box resource to use.
-
System.ArgumentException: Thrown whennameis empty. -
System.ArgumentNullException: Thrown whenstyleBoxisnull.
This method is not synchronized. Call it on the main scene thread.
This method is available since Electron2D 0.1.0 Preview.
Electron2D.Control.GetThemeStyleBox(System.String,System.String)
Kind: Method
public Electron2D.Control FindNextValidFocus()()Finds the next focusable control in this viewport.
Controls are valid focus targets only when they are inside the same
Electron2D.Viewport, visible in tree and have Electron2D.Control.FocusMode
set to a value other than Electron2D.FocusMode.None.
The explicit Electron2D.Control.FocusNext target when it is valid; otherwise,
the next focusable control in viewport tree order, or null when no
valid control exists.
This method is not synchronized. Call it on the main scene thread.
This method is available since Electron2D 0.1.0 Preview.
Electron2D.Control.FindPrevValidFocusElectron2D.Control.FocusNext
Kind: Method
public Electron2D.Control FindPrevValidFocus()()Finds the previous focusable control in this viewport.
Controls are valid focus targets only when they are inside the same
Electron2D.Viewport, visible in tree and have Electron2D.Control.FocusMode
set to a value other than Electron2D.FocusMode.None.
The explicit Electron2D.Control.FocusPrevious target when it is valid;
otherwise, the previous focusable control in viewport tree order, or
null when no valid control exists.
This method is not synchronized. Call it on the main scene thread.
This method is available since Electron2D 0.1.0 Preview.
Electron2D.Control.FindNextValidFocusElectron2D.Control.FocusPrevious
Kind: Method
public Electron2D.Vector2 GetCombinedMinimumSize()()Gets the minimum size used by layout calculations.
In the 0.1.0 Preview layout baseline this is the same value as
Electron2D.Control.GetMinimumSize. Future container and theme work can add
style contributions without changing the public call site.
The combined minimum size for this control.
This method is not synchronized. Call it on the main scene thread.
This method is available since Electron2D 0.1.0 Preview.
Electron2D.Control.GetMinimumSizeElectron2D.Control.SetSize(Electron2D.Vector2)
Kind: Method
public Electron2D.Rect2 GetGlobalRect()()Gets the rectangle occupied by this control in root viewport coordinates.
Parent Electron2D.Control positions are accumulated. A
Electron2D.Node2D parent applies its global transform to the local
position baseline.
A Electron2D.Rect2 containing the global position and computed
Electron2D.Control.Size.
This method is not synchronized. Call it on the main scene thread.
This method is available since Electron2D 0.1.0 Preview.
Electron2D.Control.GetRectElectron2D.Control.Position
Kind: Method
public Electron2D.Vector2 GetMinimumSize()()Gets the minimum size requested by this control.
This method is the minimum-size baseline used before container and theme contributions are introduced.
The component-wise maximum of Electron2D.Control.CustomMinimumSize and
Electron2D.Control._GetMinimumSize.
This method is not synchronized. Call it on the main scene thread.
This method is available since Electron2D 0.1.0 Preview.
Electron2D.Control.GetCombinedMinimumSizeElectron2D.Control._GetMinimumSize
Kind: Method
public Electron2D.Rect2 GetRect()()Gets the local rectangle occupied by this control.
The rectangle is computed from anchors and offsets against the current parent layout size.
A Electron2D.Rect2 containing Electron2D.Control.Position and
Electron2D.Control.Size.
This method is not synchronized. Call it on the main scene thread.
This method is available since Electron2D 0.1.0 Preview.
Electron2D.Control.AnchorLeftElectron2D.Control.GetGlobalRect
Kind: Method
public Electron2D.Color GetThemeColor(System.String, System.String)(System.String name, System.String themeType)Gets a color from local overrides or inherited themes.
Use Electron2D.Control.HasThemeColor(System.String,System.String) to distinguish a missing value from an explicit white value.
-
name: The theme color name. -
themeType: The optional theme type to query before this control's type chain.
The resolved color, or opaque white when no value exists.
-
System.ArgumentException: Thrown whennameis empty.
This method is not synchronized. Call it on the main scene thread.
This method is available since Electron2D 0.1.0 Preview.
Electron2D.Control.Theme
Kind: Method
public System.Int32 GetThemeConstant(System.String, System.String)(System.String name, System.String themeType)Gets an integer theme constant override by name.
Containers and controls use this method for spacing and margin values.
Local overrides have priority over inherited themes. Missing values
deliberately resolve to 0 so a caller can supply its own default.
-
name: The theme constant name. -
themeType: The optional theme type to query before this control's variation and runtime type chain.
The resolved constant after applying the resolved theme base scale, or
0 when no value 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.AddThemeConstantOverride(System.String,System.Int32)Electron2D.Control.GetThemeDefaultBaseScaleElectron2D.Control.HasThemeConstant(System.String,System.String)
Kind: Method
public System.Single GetThemeDefaultBaseScale()()Gets the resolved theme base scale.
This value is used to scale font sizes and constants resolved by this control.
The nearest valid theme base scale, or 1 when no theme supplies one.
This method is not synchronized. Call it on the main scene thread.
This method is available since Electron2D 0.1.0 Preview.
Electron2D.Theme.DefaultBaseScale
Kind: Method
public Electron2D.Font GetThemeDefaultFont()()Gets the resolved default theme font.
This value is used as fallback by Electron2D.Control.GetThemeFont(System.String,System.String).
The nearest default font, or null when no theme supplies one.
This method is not synchronized. Call it on the main scene thread.
This method is available since Electron2D 0.1.0 Preview.
Electron2D.Theme.DefaultFont
Kind: Method
public System.Int32 GetThemeDefaultFontSize()()Gets the resolved default theme font size.
This value is used as fallback by Electron2D.Control.GetThemeFontSize(System.String,System.String).
The scaled nearest default font size, or 16 when no theme supplies one.
This method is not synchronized. Call it on the main scene thread.
This method is available since Electron2D 0.1.0 Preview.
Electron2D.Theme.DefaultFontSize
Kind: Method
public Electron2D.Font GetThemeFont(System.String, System.String)(System.String name, System.String themeType)Gets a font from local overrides, inherited themes or the default theme font.
Local overrides have priority. If no local override exists, the lookup walks this control and its control parents until it finds a matching theme item or default theme font.
-
name: The theme font item name. -
themeType: The optional theme type to query before this control's variation and runtime type chain.
The resolved font resource, or null when no matching item and no
default theme font exist.
-
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.AddThemeFontOverride(System.String,Electron2D.Font)Electron2D.Control.GetThemeDefaultFontElectron2D.Theme.SetFont(System.String,System.String,Electron2D.Font)
Kind: Method
public System.Int32 GetThemeFontSize(System.String, System.String)(System.String name, System.String themeType)Gets a scaled font size from local overrides, inherited themes or fallback values.
Local overrides and theme values are stored as logical UI units.
GetThemeFontSize multiplies the value by
Electron2D.Control.GetThemeDefaultBaseScale and rounds it to at least
1.
-
name: The theme font size item name. -
themeType: The optional theme type to query before this control's variation and runtime type chain.
The resolved font size after applying the resolved theme base scale.
The fallback value is 16 before scaling.
-
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.AddThemeFontSizeOverride(System.String,System.Int32)Electron2D.Control.GetThemeDefaultBaseScaleElectron2D.Theme.SetFontSize(System.String,System.String,System.Int32)
Kind: Method
public Electron2D.Texture2D GetThemeIcon(System.String, System.String)(System.String name, System.String themeType)Gets an icon from local overrides or inherited themes.
Icon lookup follows the same branch theme rules as colors and fonts.
-
name: The theme icon name. -
themeType: The optional theme type to query before this control's type chain.
The resolved icon, or null when no value exists.
-
System.ArgumentException: Thrown whennameis empty.
This method is not synchronized. Call it on the main scene thread.
This method is available since Electron2D 0.1.0 Preview.
Electron2D.Theme.SetIcon(System.String,System.String,Electron2D.Texture2D)
Kind: Method
public Electron2D.StyleBox GetThemeStyleBox(System.String, System.String)(System.String name, System.String themeType)Gets a style box from local overrides or inherited themes.
Style boxes are used by controls that draw themed backgrounds and borders.
-
name: The theme style box name. -
themeType: The optional theme type to query before this control's type chain.
The resolved style box, or null when no value exists.
-
System.ArgumentException: Thrown whennameis empty.
This method is not synchronized. Call it on the main scene thread.
This method is available since Electron2D 0.1.0 Preview.
Electron2D.StyleBox
Kind: Method
public System.String GetTooltip(Electron2D.Vector2)(Electron2D.Vector2 atPosition)Gets tooltip text for a local pointer position.
This method wraps Electron2D.Control._GetTooltip(Electron2D.Vector2) and normalizes a
null result to an empty string.
-
atPosition: The pointer position in this control's local coordinate space.
The tooltip text, or an empty string when no tooltip is available.
This method is not synchronized. Call it on the main scene thread.
This method is available since Electron2D 0.1.0 Preview.
Electron2D.Control.TooltipTextElectron2D.Control._MakeCustomTooltip(System.String)
Kind: Method
public System.Void GrabFocus()()Gives keyboard and gamepad focus to this control.
The control must be inside a scene tree, visible in that tree and have
Electron2D.Control.FocusMode set to a value other than
Electron2D.FocusMode.None. If any of those conditions is
not met, the call has no effect.
This method is not synchronized. Call it on the main scene thread.
This method is available since Electron2D 0.1.0 Preview.
Electron2D.Control.FocusModeElectron2D.Control.HasFocusElectron2D.Control.ReleaseFocus
Kind: Method
public System.Boolean HasFocus()()Checks whether this control currently owns focus in its viewport.
Hidden controls and controls outside a scene tree do not report focus, even if they were the last control selected before becoming invalid for focus dispatch.
true when this control is the focused visible control in its
viewport; otherwise, false.
This method is not synchronized. Call it on the main scene thread.
This method is available since Electron2D 0.1.0 Preview.
Electron2D.Control.GrabFocusElectron2D.Control.ReleaseFocus
Kind: Method
public System.Boolean HasThemeColor(System.String, System.String)(System.String name, System.String themeType)Reports whether a color can be resolved.
This method checks local overrides and inherited themes.
-
name: The theme color name. -
themeType: The optional theme type to query before this control's type chain.
true when a local or theme color exists; otherwise, false.
-
System.ArgumentException: Thrown whennameis empty.
This method is not synchronized. Call it on the main scene thread.
This method is available since Electron2D 0.1.0 Preview.
Electron2D.Control.GetThemeColor(System.String,System.String)
Kind: Method
public System.Boolean HasThemeColorOverride(System.String)(System.String name)Reports whether this control has a local color override.
This method does not inspect assigned theme resources.
-
name: The theme color name.
true when an override exists; otherwise, false.
-
System.ArgumentException: Thrown whennameis empty.
This method is not synchronized. Call it on the main scene thread.
This method is available since Electron2D 0.1.0 Preview.
Electron2D.Control.AddThemeColorOverride(System.String,Electron2D.Color)
Kind: Method
public System.Boolean HasThemeConstant(System.String, System.String)(System.String name, System.String themeType)Reports whether a constant can be resolved.
This method checks local overrides and inherited themes.
-
name: The theme constant name. -
themeType: The optional theme type to query before this control's type chain.
true when a local or theme constant exists; otherwise, false.
-
System.ArgumentException: Thrown whennameis empty.
This method is not synchronized. Call it on the main scene thread.
This method is available since Electron2D 0.1.0 Preview.
Electron2D.Control.GetThemeConstant(System.String,System.String)
Kind: Method
public System.Boolean HasThemeConstantOverride(System.String)(System.String name)Reports whether this control has a theme constant override by name.
This method lets container code distinguish a missing value from an explicit zero value.
-
name: The theme constant name.
true when an override exists; otherwise, false.
-
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.AddThemeConstantOverride(System.String,System.Int32)Electron2D.Control.GetThemeConstant(System.String,System.String)
Kind: Method
public System.Boolean HasThemeFontOverride(System.String)(System.String name)Reports whether this control has a local font override.
This method does not inspect assigned theme resources.
-
name: The theme font name.
true when an override exists; otherwise, false.
-
System.ArgumentException: Thrown whennameis empty.
This method is not synchronized. Call it on the main scene thread.
This method is available since Electron2D 0.1.0 Preview.
Electron2D.Control.AddThemeFontOverride(System.String,Electron2D.Font)
Kind: Method
public System.Boolean HasThemeFontSizeOverride(System.String)(System.String name)Reports whether this control has a local font size override.
This method does not inspect assigned theme resources.
-
name: The theme font size name.
true when an override exists; otherwise, false.
-
System.ArgumentException: Thrown whennameis empty.
This method is not synchronized. Call it on the main scene thread.
This method is available since Electron2D 0.1.0 Preview.
Electron2D.Control.AddThemeFontSizeOverride(System.String,System.Int32)
Kind: Method
public System.Boolean HasThemeIcon(System.String, System.String)(System.String name, System.String themeType)Reports whether an icon can be resolved.
This method checks local overrides and inherited themes.
-
name: The theme icon name. -
themeType: The optional theme type to query before this control's type chain.
true when a local or theme icon exists; otherwise, false.
-
System.ArgumentException: Thrown whennameis empty.
This method is not synchronized. Call it on the main scene thread.
This method is available since Electron2D 0.1.0 Preview.
Electron2D.Control.GetThemeIcon(System.String,System.String)
Kind: Method
public System.Boolean HasThemeIconOverride(System.String)(System.String name)Reports whether this control has a local icon override.
This method does not inspect assigned theme resources.
-
name: The theme icon name.
true when an override exists; otherwise, false.
-
System.ArgumentException: Thrown whennameis empty.
This method is not synchronized. Call it on the main scene thread.
This method is available since Electron2D 0.1.0 Preview.
Electron2D.Control.AddThemeIconOverride(System.String,Electron2D.Texture2D)
Kind: Method
public System.Boolean HasThemeStyleBox(System.String, System.String)(System.String name, System.String themeType)Reports whether a style box can be resolved.
This method checks local overrides and inherited themes.
-
name: The theme style box name. -
themeType: The optional theme type to query before this control's type chain.
true when a local or theme style box exists; otherwise, false.
-
System.ArgumentException: Thrown whennameis empty.
This method is not synchronized. Call it on the main scene thread.
This method is available since Electron2D 0.1.0 Preview.
Electron2D.Control.GetThemeStyleBox(System.String,System.String)
Kind: Method
public System.Boolean HasThemeStyleBoxOverride(System.String)(System.String name)Reports whether this control has a local style box override.
This method does not inspect assigned theme resources.
-
name: The theme style box name.
true when an override exists; otherwise, false.
-
System.ArgumentException: Thrown whennameis empty.
This method is not synchronized. Call it on the main scene thread.
This method is available since Electron2D 0.1.0 Preview.
Electron2D.Control.AddThemeStyleBoxOverride(System.String,Electron2D.StyleBox)
Kind: Method
public System.Void ReleaseFocus()()Releases focus from this control when it currently owns it.
Calling this method on a control that does not currently own focus is a no-op.
This method is not synchronized. Call it on the main scene thread.
This method is available since Electron2D 0.1.0 Preview.
Electron2D.Control.GrabFocusElectron2D.Control.HasFocus
Kind: Method
public System.Void RemoveThemeColorOverride(System.String)(System.String name)Removes a color theme override from this control.
Removing a missing override is a no-op.
-
name: The theme color name.
-
System.ArgumentException: Thrown whennameis empty.
This method is not synchronized. Call it on the main scene thread.
This method is available since Electron2D 0.1.0 Preview.
Electron2D.Control.HasThemeColorOverride(System.String)
Kind: Method
public System.Void RemoveThemeConstantOverride(System.String)(System.String name)Removes a constant theme override from this control.
Removing a missing override is a no-op.
-
name: The theme constant name.
-
System.ArgumentException: Thrown whennameis empty.
This method is not synchronized. Call it on the main scene thread.
This method is available since Electron2D 0.1.0 Preview.
Electron2D.Control.HasThemeConstantOverride(System.String)
Kind: Method
public System.Void RemoveThemeFontOverride(System.String)(System.String name)Removes a font theme override from this control.
Removing a missing override is a no-op.
-
name: The theme font name.
-
System.ArgumentException: Thrown whennameis empty.
This method is not synchronized. Call it on the main scene thread.
This method is available since Electron2D 0.1.0 Preview.
Electron2D.Control.HasThemeFontOverride(System.String)
Kind: Method
public System.Void RemoveThemeFontSizeOverride(System.String)(System.String name)Removes a font size theme override from this control.
Removing a missing override is a no-op.
-
name: The theme font size name.
-
System.ArgumentException: Thrown whennameis empty.
This method is not synchronized. Call it on the main scene thread.
This method is available since Electron2D 0.1.0 Preview.
Electron2D.Control.HasThemeFontSizeOverride(System.String)
Kind: Method
public System.Void RemoveThemeIconOverride(System.String)(System.String name)Removes an icon theme override from this control.
Removing a missing override is a no-op.
-
name: The theme icon name.
-
System.ArgumentException: Thrown whennameis empty.
This method is not synchronized. Call it on the main scene thread.
This method is available since Electron2D 0.1.0 Preview.
Electron2D.Control.HasThemeIconOverride(System.String)
Kind: Method
public System.Void RemoveThemeStyleBoxOverride(System.String)(System.String name)Removes a style box theme override from this control.
Removing a missing override is a no-op.
-
name: The theme style box name.
-
System.ArgumentException: Thrown whennameis empty.
This method is not synchronized. Call it on the main scene thread.
This method is available since Electron2D 0.1.0 Preview.
Electron2D.Control.HasThemeStyleBoxOverride(System.String)
Kind: Method
public System.Void ResetSize()()Resets this control size to its combined minimum size.
The current Electron2D.Control.GrowHorizontal and Electron2D.Control.GrowVertical
values decide whether the beginning side, ending side or both sides move
while the rectangle changes.
This method is not synchronized. Call it on the main scene thread.
This method is available since Electron2D 0.1.0 Preview.
Electron2D.Control.GetCombinedMinimumSizeElectron2D.Control.SetSize(Electron2D.Vector2)
Kind: Method
public System.Void SetSize(Electron2D.Vector2)(Electron2D.Vector2 size)Sets the computed size of this control.
If size is smaller than
Electron2D.Control.GetCombinedMinimumSize, this method grows the final
rectangle according to Electron2D.Control.GrowHorizontal and
Electron2D.Control.GrowVertical.
-
size: The requested size in local coordinates.
-
System.ArgumentOutOfRangeException: Thrown when a component ofsizeis negative or not finite.
This method is not synchronized. Call it on the main scene thread.
This method is available since Electron2D 0.1.0 Preview.
Electron2D.Control.ResetSizeElectron2D.Control.Size
Kind: Method
public Electron2D.Vector2 _GetMinimumSize()()Called to compute the control-specific minimum size.
Derived controls can override this method to reserve space for text,
textures or other content. Negative or non-finite components returned
by an override are treated as 0.
User code should normally call Electron2D.Control.GetMinimumSize or
Electron2D.Control.GetCombinedMinimumSize instead of calling this method
directly.
The minimum size requested by this control implementation.
This method is not synchronized. It is called on the main scene thread during layout calculations.
This method is available since Electron2D 0.1.0 Preview.
Electron2D.Control.CustomMinimumSizeElectron2D.Control.GetMinimumSize
Kind: Method
public System.String _GetTooltip(Electron2D.Vector2)(Electron2D.Vector2 atPosition)Called to resolve tooltip text for a local pointer position.
The base implementation returns Electron2D.Control.TooltipText. Derived
controls can return different text for different subregions.
-
atPosition: The pointer position in this control's local coordinate space.
The tooltip text for the position, or an empty string when no tooltip should be shown.
This method is not synchronized. It is called on the main scene thread.
This method is available since Electron2D 0.1.0 Preview.
Electron2D.Control.GetTooltip(Electron2D.Vector2)Electron2D.Control._MakeCustomTooltip(System.String)
Kind: Method
public System.Void _GuiInput(Electron2D.InputEvent)(Electron2D.InputEvent inputEvent)Called when a GUI input event is delivered to this control.
Mouse events reach this method when the event position falls inside the
control rectangle and Electron2D.Control.MouseFilter is not
Electron2D.MouseFilter.Ignore. Non-mouse events reach only the
currently focused control.
Call Electron2D.Control.AcceptEvent to stop further propagation of the
current event.
-
inputEvent: The input event delivered by the containingElectron2D.Viewport.
This method is not synchronized. It is called on the main scene thread during input dispatch.
This method is available since Electron2D 0.1.0 Preview.
Electron2D.Control.AcceptEventElectron2D.Control.FocusModeElectron2D.Control.MouseFilter
Kind: Method
public Electron2D.Control _MakeCustomTooltip(System.String)(System.String forText)Called to create a custom tooltip control for resolved text.
The base implementation returns null. Callers that show tooltip
visuals own the returned control's lifetime.
-
forText: The tooltip text returned byElectron2D.Control.GetTooltip(Electron2D.Vector2).
A control used as a custom tooltip, or null to use the default
tooltip presentation.
This method is not synchronized. It is called on the main scene thread.
This method is available since Electron2D 0.1.0 Preview.
Electron2D.Control.GetTooltip(Electron2D.Vector2)
Electron2D 0.1.0 Preview API reference. Generated from 175 public runtime types.