Skip to content

Control

Eduard Gushchin edited this page Jul 1, 2026 · 9 revisions

Home | API by Category | Complete API Index | API Compatibility

Field Value
Full name Electron2D.Control
Namespace Electron2D
Kind class
Category UI and Text

Overview

Provides the Electron2D base node for 2D user interface controls.

Syntax

public class Electron2D.Control : Electron2D.CanvasItem

Godot 4.7 C# profile compatibility

Profile: 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.

Remarks

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.

Thread Safety

This type is not synchronized. Create and mutate controls on the main scene thread.

Since

This type is available since Electron2D 0.1.0 Preview.

See Also

  • Electron2D.CanvasItem
  • Electron2D.Label

Members

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.

Member Details

AnchorBottom

Kind: Property

public System.Single AnchorBottom { get; set; }

Summary

Gets or sets the bottom anchor of this control.

Remarks

The final bottom edge is calculated as the parent layout height multiplied by this value, plus Electron2D.Control.OffsetBottom.

Value

The bottom anchor as a fraction of the parent layout size.

Thread Safety

This property is not synchronized. Mutate it on the main scene thread.

Since

This property is available since Electron2D 0.1.0 Preview.

See Also

  • Electron2D.Control.AnchorTop
  • Electron2D.Control.OffsetBottom

AnchorLeft

Kind: Property

public System.Single AnchorLeft { get; set; }

Summary

Gets or sets the left anchor of this control.

Remarks

The final left edge is calculated as the parent layout width multiplied by this value, plus Electron2D.Control.OffsetLeft.

Value

The left anchor as a fraction of the parent layout size.

Thread Safety

This property is not synchronized. Mutate it on the main scene thread.

Since

This property is available since Electron2D 0.1.0 Preview.

See Also

  • Electron2D.Control.AnchorRight
  • Electron2D.Control.OffsetLeft

AnchorRight

Kind: Property

public System.Single AnchorRight { get; set; }

Summary

Gets or sets the right anchor of this control.

Remarks

The final right edge is calculated as the parent layout width multiplied by this value, plus Electron2D.Control.OffsetRight.

Value

The right anchor as a fraction of the parent layout size.

Thread Safety

This property is not synchronized. Mutate it on the main scene thread.

Since

This property is available since Electron2D 0.1.0 Preview.

See Also

  • Electron2D.Control.AnchorLeft
  • Electron2D.Control.OffsetRight

AnchorTop

Kind: Property

public System.Single AnchorTop { get; set; }

Summary

Gets or sets the top anchor of this control.

Remarks

The final top edge is calculated as the parent layout height multiplied by this value, plus Electron2D.Control.OffsetTop.

Value

The top anchor as a fraction of the parent layout size.

Thread Safety

This property is not synchronized. Mutate it on the main scene thread.

Since

This property is available since Electron2D 0.1.0 Preview.

See Also

  • Electron2D.Control.AnchorBottom
  • Electron2D.Control.OffsetTop

ClipContents

Kind: Property

public System.Boolean ClipContents { get; set; }

Summary

Gets or sets whether this control clips GUI hit-testing for its descendants.

Remarks

The 0.1.0 Preview baseline applies this flag to mouse and touch dispatch. Renderer scissor integration is handled by later rendering backend work.

Value

true to prevent descendants from receiving pointer input outside this control's global rectangle; otherwise, false.

Thread Safety

This property is not synchronized. Mutate it on the main scene thread.

Since

This property is available since Electron2D 0.1.0 Preview.

See Also

  • Electron2D.Control.GetGlobalRect
  • Electron2D.Control.MouseFilter

CustomMinimumSize

Kind: Property

public Electron2D.Vector2 CustomMinimumSize { get; set; }

Summary

Gets or sets the custom minimum size of this control.

Remarks

This value is combined with Electron2D.Control._GetMinimumSize by Electron2D.Control.GetMinimumSize.

Value

The user-defined minimum size. Components must be finite and non-negative.

Exceptions

  • System.ArgumentOutOfRangeException: Thrown when a component is negative or not finite.

Thread Safety

This property is not synchronized. Mutate it on the main scene thread.

Since

This property is available since Electron2D 0.1.0 Preview.

See Also

  • Electron2D.Control.GetCombinedMinimumSize
  • Electron2D.Control._GetMinimumSize

FocusMode

Kind: Property

public Electron2D.FocusMode FocusMode { get; set; }

Summary

Gets or sets how this control can receive focus.

Remarks

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.

Value

The current Electron2D.FocusMode value. The default is Electron2D.FocusMode.None.

Thread Safety

This property is not synchronized. Mutate it on the main scene thread.

Since

This property is available since Electron2D 0.1.0 Preview.

See Also

  • Electron2D.Control.FocusMode
  • Electron2D.Control.GrabFocus
  • Electron2D.Control.HasFocus

FocusNeighborBottom

Kind: Property

public Electron2D.NodePath FocusNeighborBottom { get; set; }

Summary

Gets or sets the explicit focus target used for bottom-direction navigation.

Remarks

Directional focus paths are used by the viewport keyboard navigation baseline when arrow-key navigation is requested.

Value

A Electron2D.NodePath resolved from this control. The default value is an empty path.

Thread Safety

This property is not synchronized. Mutate it on the main scene thread.

Since

This property is available since Electron2D 0.1.0 Preview.

See Also

  • Electron2D.Control.FocusNeighborTop

FocusNeighborLeft

Kind: Property

public Electron2D.NodePath FocusNeighborLeft { get; set; }

Summary

Gets or sets the explicit focus target used for left-direction navigation.

Remarks

Directional focus paths are used by the viewport keyboard navigation baseline when arrow-key navigation is requested.

Value

A Electron2D.NodePath resolved from this control. The default value is an empty path.

Thread Safety

This property is not synchronized. Mutate it on the main scene thread.

Since

This property is available since Electron2D 0.1.0 Preview.

See Also

  • Electron2D.Control.FocusNeighborRight

FocusNeighborRight

Kind: Property

public Electron2D.NodePath FocusNeighborRight { get; set; }

Summary

Gets or sets the explicit focus target used for right-direction navigation.

Remarks

Directional focus paths are used by the viewport keyboard navigation baseline when arrow-key navigation is requested.

Value

A Electron2D.NodePath resolved from this control. The default value is an empty path.

Thread Safety

This property is not synchronized. Mutate it on the main scene thread.

Since

This property is available since Electron2D 0.1.0 Preview.

See Also

  • Electron2D.Control.FocusNeighborLeft

FocusNeighborTop

Kind: Property

public Electron2D.NodePath FocusNeighborTop { get; set; }

Summary

Gets or sets the explicit focus target used for top-direction navigation.

Remarks

Directional focus paths are used by the viewport keyboard navigation baseline when arrow-key navigation is requested.

Value

A Electron2D.NodePath resolved from this control. The default value is an empty path.

Thread Safety

This property is not synchronized. Mutate it on the main scene thread.

Since

This property is available since Electron2D 0.1.0 Preview.

See Also

  • Electron2D.Control.FocusNeighborBottom

FocusNext

Kind: Property

public Electron2D.NodePath FocusNext { get; set; }

Summary

Gets or sets the explicit focus target used when navigating to the next control.

Remarks

Electron2D.Control.FindNextValidFocus uses this path before falling back to viewport tree order.

Value

A Electron2D.NodePath resolved from this control. The default value is an empty path.

Thread Safety

This property is not synchronized. Mutate it on the main scene thread.

Since

This property is available since Electron2D 0.1.0 Preview.

See Also

  • Electron2D.Control.FindNextValidFocus
  • Electron2D.Control.FocusPrevious

FocusPrevious

Kind: Property

public Electron2D.NodePath FocusPrevious { get; set; }

Summary

Gets or sets the explicit focus target used when navigating to the previous control.

Remarks

Electron2D.Control.FindPrevValidFocus uses this path before falling back to viewport tree order.

Value

A Electron2D.NodePath resolved from this control. The default value is an empty path.

Thread Safety

This property is not synchronized. Mutate it on the main scene thread.

Since

This property is available since Electron2D 0.1.0 Preview.

See Also

  • Electron2D.Control.FindPrevValidFocus
  • Electron2D.Control.FocusNext

GrowHorizontal

Kind: Property

public Electron2D.GrowDirection GrowHorizontal { get; set; }

Summary

Gets or sets the horizontal grow direction used when minimum size expands this control.

Remarks

This value is used by Electron2D.Control.SetSize(Electron2D.Vector2) and Electron2D.Control.ResetSize when the requested width is smaller than the minimum width.

Value

The horizontal Electron2D.GrowDirection. The default is Electron2D.GrowDirection.End.

Thread Safety

This property is not synchronized. Mutate it on the main scene thread.

Since

This property is available since Electron2D 0.1.0 Preview.

See Also

  • Electron2D.Control.GrowVertical
  • Electron2D.GrowDirection

GrowVertical

Kind: Property

public Electron2D.GrowDirection GrowVertical { get; set; }

Summary

Gets or sets the vertical grow direction used when minimum size expands this control.

Remarks

This value is used by Electron2D.Control.SetSize(Electron2D.Vector2) and Electron2D.Control.ResetSize when the requested height is smaller than the minimum height.

Value

The vertical Electron2D.GrowDirection. The default is Electron2D.GrowDirection.End.

Thread Safety

This property is not synchronized. Mutate it on the main scene thread.

Since

This property is available since Electron2D 0.1.0 Preview.

See Also

  • Electron2D.Control.GrowHorizontal
  • Electron2D.GrowDirection

MouseFilter

Kind: Property

public Electron2D.MouseFilter MouseFilter { get; set; }

Summary

Gets or sets how this control receives and consumes mouse input.

Remarks

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.

Value

The current Electron2D.Control.MouseFilter value. The default is Electron2D.MouseFilter.Stop.

Thread Safety

This property is not synchronized. Mutate it on the main scene thread.

Since

This property is available since Electron2D 0.1.0 Preview.

See Also

  • Electron2D.Control.MouseFilter
  • Electron2D.Control._GuiInput(Electron2D.InputEvent)

OffsetBottom

Kind: Property

public System.Single OffsetBottom { get; set; }

Summary

Gets or sets the bottom offset of this control.

Remarks

The bottom offset can be negative when the bottom edge should stay inset from the parent layout rectangle.

Value

The pixel offset applied to Electron2D.Control.AnchorBottom.

Thread Safety

This property is not synchronized. Mutate it on the main scene thread.

Since

This property is available since Electron2D 0.1.0 Preview.

See Also

  • Electron2D.Control.AnchorBottom
  • Electron2D.Control.OffsetTop

OffsetLeft

Kind: Property

public System.Single OffsetLeft { get; set; }

Summary

Gets or sets the left offset of this control.

Remarks

Offsets are expressed in the local coordinate space of the parent layout rectangle.

Value

The pixel offset applied to Electron2D.Control.AnchorLeft.

Thread Safety

This property is not synchronized. Mutate it on the main scene thread.

Since

This property is available since Electron2D 0.1.0 Preview.

See Also

  • Electron2D.Control.AnchorLeft
  • Electron2D.Control.OffsetRight

OffsetRight

Kind: Property

public System.Single OffsetRight { get; set; }

Summary

Gets or sets the right offset of this control.

Remarks

The right offset can be negative when the right edge should stay inset from the parent layout rectangle.

Value

The pixel offset applied to Electron2D.Control.AnchorRight.

Thread Safety

This property is not synchronized. Mutate it on the main scene thread.

Since

This property is available since Electron2D 0.1.0 Preview.

See Also

  • Electron2D.Control.AnchorRight
  • Electron2D.Control.OffsetLeft

OffsetTop

Kind: Property

public System.Single OffsetTop { get; set; }

Summary

Gets or sets the top offset of this control.

Remarks

Offsets are expressed in the local coordinate space of the parent layout rectangle.

Value

The pixel offset applied to Electron2D.Control.AnchorTop.

Thread Safety

This property is not synchronized. Mutate it on the main scene thread.

Since

This property is available since Electron2D 0.1.0 Preview.

See Also

  • Electron2D.Control.AnchorTop
  • Electron2D.Control.OffsetBottom

Position

Kind: Property

public Electron2D.Vector2 Position { get; set; }

Summary

Gets or sets the local position of this control.

Remarks

Setting this property updates offsets while preserving anchors and the current computed Electron2D.Control.Size.

Value

The top-left corner of the computed local rectangle.

Thread Safety

This property is not synchronized. Mutate it on the main scene thread.

Since

This property is available since Electron2D 0.1.0 Preview.

See Also

  • Electron2D.Control.GetGlobalRect
  • Electron2D.Control.GetRect

Size

Kind: Property

public Electron2D.Vector2 Size { get; set; }

Summary

Gets or sets the local size of this control.

Remarks

Setting this property is equivalent to calling Electron2D.Control.SetSize(Electron2D.Vector2).

Value

The computed local rectangle size.

Thread Safety

This property is not synchronized. Mutate it on the main scene thread.

Since

This property is available since Electron2D 0.1.0 Preview.

See Also

  • Electron2D.Control.GetCombinedMinimumSize
  • Electron2D.Control.SetSize(Electron2D.Vector2)

SizeFlagsHorizontal

Kind: Property

public Electron2D.SizeFlags SizeFlagsHorizontal { get; set; }

Summary

Gets or sets the horizontal size flags used by a parent Electron2D.Container.

Remarks

This property is read by layout containers only. It does not change this control's rectangle until a parent container performs layout.

Value

A Electron2D.SizeFlags value that describes how this control should use horizontal space allocated by a container.

Thread Safety

This property is not synchronized. Mutate it on the main scene thread.

Since

This property is available since Electron2D 0.1.0 Preview.

See Also

  • Electron2D.Container
  • Electron2D.Control.SizeFlagsStretchRatio
  • Electron2D.Control.SizeFlagsVertical

SizeFlagsStretchRatio

Kind: Property

public System.Single SizeFlagsStretchRatio { get; set; }

Summary

Gets or sets the expansion weight used by a parent Electron2D.Container.

Remarks

The value is considered only when the relevant size flag contains Electron2D.SizeFlags.Expand or Electron2D.SizeFlags.ExpandFill.

Value

The positive finite ratio used when a container distributes free space between expanding children.

Exceptions

  • System.ArgumentOutOfRangeException: Thrown when the value is not finite or is less than or equal to zero.

Thread Safety

This property is not synchronized. Mutate it on the main scene thread.

Since

This property is available since Electron2D 0.1.0 Preview.

See Also

  • Electron2D.Control.SizeFlagsHorizontal
  • Electron2D.Control.SizeFlagsVertical

SizeFlagsVertical

Kind: Property

public Electron2D.SizeFlags SizeFlagsVertical { get; set; }

Summary

Gets or sets the vertical size flags used by a parent Electron2D.Container.

Remarks

This property is read by layout containers only. It does not change this control's rectangle until a parent container performs layout.

Value

A Electron2D.SizeFlags value that describes how this control should use vertical space allocated by a container.

Thread Safety

This property is not synchronized. Mutate it on the main scene thread.

Since

This property is available since Electron2D 0.1.0 Preview.

See Also

  • Electron2D.Container
  • Electron2D.Control.SizeFlagsHorizontal
  • Electron2D.Control.SizeFlagsStretchRatio

Theme

Kind: Property

public Electron2D.Theme Theme { get; set; }

Summary

Gets or sets the theme resource applied to this control branch.

Remarks

A theme assigned to a control is used by that control and by descendant controls while the parent chain remains made of controls.

Value

The theme resource assigned to this control, or null when this control should inherit a theme from its parent controls.

Thread Safety

This property is not synchronized. Mutate it on the main scene thread.

Since

This property is available since Electron2D 0.1.0 Preview.

See Also

  • Electron2D.Control.GetThemeColor(System.String,System.String)
  • Electron2D.Control.Theme

ThemeTypeVariation

Kind: Property

public System.String ThemeTypeVariation { get; set; }

Summary

Gets or sets the theme type variation used before this control type.

Remarks

A non-empty value gives a theme a way to style one control differently from other controls of the same runtime type.

Value

The variation name, or an empty string when no variation is used.

Thread Safety

This property is not synchronized. Mutate it on the main scene thread.

Since

This property is available since Electron2D 0.1.0 Preview.

See Also

  • Electron2D.Control.Theme

TooltipText

Kind: Property

public System.String TooltipText { get; set; }

Summary

Gets or sets the default tooltip text for this control.

Remarks

Override Electron2D.Control._GetTooltip(Electron2D.Vector2) when the text depends on the pointer position.

Value

The tooltip text. A null assignment is normalized to an empty string.

Thread Safety

This property is not synchronized. Mutate it on the main scene thread.

Since

This property is available since Electron2D 0.1.0 Preview.

See Also

  • Electron2D.Control.GetTooltip(Electron2D.Vector2)

Electron2D.Control()

Kind: Constructor

public Electron2D.Control()

Summary

Initializes a new instance of the Control type.

Remarks

The new instance follows the lifetime and validation rules of its declaring type.

Thread Safety

This member is not synchronized. Call it from the thread that owns the related object unless the declaring type states otherwise.

Since

This API is available since Electron2D 0.1.0 Preview.

See Also

  • Electron2D.Control

AcceptEvent()

Kind: Method

public System.Void AcceptEvent()()

Summary

Marks the current GUI input event as handled.

Remarks

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.

Thread Safety

This method is not synchronized. Call it on the main scene thread while handling Electron2D.Control._GuiInput(Electron2D.InputEvent).

Since

This method is available since Electron2D 0.1.0 Preview.

See Also

  • Electron2D.Control._GuiInput(Electron2D.InputEvent)
  • Electron2D.Viewport.SetInputAsHandled

AddThemeColorOverride(System.String, Electron2D.Color)

Kind: Method

public System.Void AddThemeColorOverride(System.String, Electron2D.Color)(System.String name, Electron2D.Color color)

Summary

Adds or replaces a color theme override for this control.

Remarks

Local overrides have priority over assigned theme resources.

Parameters

  • name: The theme color name.
  • color: The color value to use.

Exceptions

  • System.ArgumentException: Thrown when name is empty.

Thread Safety

This method is not synchronized. Call it on the main scene thread.

Since

This method is available since Electron2D 0.1.0 Preview.

See Also

  • Electron2D.Control.GetThemeColor(System.String,System.String)

AddThemeConstantOverride(System.String, System.Int32)

Kind: Method

public System.Void AddThemeConstantOverride(System.String, System.Int32)(System.String name, System.Int32 constant)

Summary

Adds or replaces an integer theme constant override for this control.

Remarks

The 0.1.0 Preview UI containers use this baseline for spacing and margins before full theme resources are introduced.

Parameters

  • name: The theme constant name, for example separation or margin_left.
  • constant: The non-negative constant value in pixels.

Exceptions

  • System.ArgumentException: Thrown when name is null, empty or whitespace.
  • System.ArgumentOutOfRangeException: Thrown when constant is less than zero.

Thread Safety

This method is not synchronized. Call it on the main scene thread.

Since

This method is available since Electron2D 0.1.0 Preview.

See Also

  • Electron2D.Container
  • Electron2D.Control.GetThemeConstant(System.String,System.String)
  • Electron2D.Control.HasThemeConstantOverride(System.String)

AddThemeFontOverride(System.String, Electron2D.Font)

Kind: Method

public System.Void AddThemeFontOverride(System.String, Electron2D.Font)(System.String name, Electron2D.Font font)

Summary

Adds or replaces a font theme override for this control.

Remarks

This method follows the validation and lifetime rules of its declaring type.

Parameters

  • name: The theme font name, for example font.
  • font: The font resource to use.

Exceptions

  • System.ArgumentException: Thrown when name is null, empty or whitespace.
  • System.ArgumentNullException: Thrown when font is null.

Thread Safety

This method is not synchronized. Call it on the main scene thread.

Since

This method is available since Electron2D 0.1.0 Preview.

See Also

  • Electron2D.Control

AddThemeFontSizeOverride(System.String, System.Int32)

Kind: Method

public System.Void AddThemeFontSizeOverride(System.String, System.Int32)(System.String name, System.Int32 fontSize)

Summary

Adds or replaces a font size theme override for this control.

Remarks

This method follows the validation and lifetime rules of its declaring type.

Parameters

  • name: The theme font size name, for example font_size.
  • fontSize: The font size in pixels. It must be greater than zero.

Exceptions

  • System.ArgumentException: Thrown when name is null, empty or whitespace.
  • System.ArgumentOutOfRangeException: Thrown when fontSize is less than or equal to zero.

Thread Safety

This method is not synchronized. Call it on the main scene thread.

Since

This method is available since Electron2D 0.1.0 Preview.

See Also

  • Electron2D.Control

AddThemeIconOverride(System.String, Electron2D.Texture2D)

Kind: Method

public System.Void AddThemeIconOverride(System.String, Electron2D.Texture2D)(System.String name, Electron2D.Texture2D icon)

Summary

Adds or replaces an icon theme override for this control.

Remarks

Local overrides have priority over assigned theme resources.

Parameters

  • name: The theme icon name.
  • icon: The texture resource to use.

Exceptions

  • System.ArgumentException: Thrown when name is empty.
  • System.ArgumentNullException: Thrown when icon is null.

Thread Safety

This method is not synchronized. Call it on the main scene thread.

Since

This method is available since Electron2D 0.1.0 Preview.

See Also

  • Electron2D.Control.GetThemeIcon(System.String,System.String)

AddThemeStyleBoxOverride(System.String, Electron2D.StyleBox)

Kind: Method

public System.Void AddThemeStyleBoxOverride(System.String, Electron2D.StyleBox)(System.String name, Electron2D.StyleBox styleBox)

Summary

Adds or replaces a style box theme override for this control.

Remarks

Local overrides have priority over assigned theme resources.

Parameters

  • name: The theme style box name.
  • styleBox: The style box resource to use.

Exceptions

  • System.ArgumentException: Thrown when name is empty.
  • System.ArgumentNullException: Thrown when styleBox is null.

Thread Safety

This method is not synchronized. Call it on the main scene thread.

Since

This method is available since Electron2D 0.1.0 Preview.

See Also

  • Electron2D.Control.GetThemeStyleBox(System.String,System.String)

FindNextValidFocus()

Kind: Method

public Electron2D.Control FindNextValidFocus()()

Summary

Finds the next focusable control in this viewport.

Remarks

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.

Returns

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.

Thread Safety

This method is not synchronized. Call it on the main scene thread.

Since

This method is available since Electron2D 0.1.0 Preview.

See Also

  • Electron2D.Control.FindPrevValidFocus
  • Electron2D.Control.FocusNext

FindPrevValidFocus()

Kind: Method

public Electron2D.Control FindPrevValidFocus()()

Summary

Finds the previous focusable control in this viewport.

Remarks

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.

Returns

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.

Thread Safety

This method is not synchronized. Call it on the main scene thread.

Since

This method is available since Electron2D 0.1.0 Preview.

See Also

  • Electron2D.Control.FindNextValidFocus
  • Electron2D.Control.FocusPrevious

GetCombinedMinimumSize()

Kind: Method

public Electron2D.Vector2 GetCombinedMinimumSize()()

Summary

Gets the minimum size used by layout calculations.

Remarks

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.

Returns

The combined minimum size for this control.

Thread Safety

This method is not synchronized. Call it on the main scene thread.

Since

This method is available since Electron2D 0.1.0 Preview.

See Also

  • Electron2D.Control.GetMinimumSize
  • Electron2D.Control.SetSize(Electron2D.Vector2)

GetGlobalRect()

Kind: Method

public Electron2D.Rect2 GetGlobalRect()()

Summary

Gets the rectangle occupied by this control in root viewport coordinates.

Remarks

Parent Electron2D.Control positions are accumulated. A Electron2D.Node2D parent applies its global transform to the local position baseline.

Returns

A Electron2D.Rect2 containing the global position and computed Electron2D.Control.Size.

Thread Safety

This method is not synchronized. Call it on the main scene thread.

Since

This method is available since Electron2D 0.1.0 Preview.

See Also

  • Electron2D.Control.GetRect
  • Electron2D.Control.Position

GetMinimumSize()

Kind: Method

public Electron2D.Vector2 GetMinimumSize()()

Summary

Gets the minimum size requested by this control.

Remarks

This method is the minimum-size baseline used before container and theme contributions are introduced.

Returns

The component-wise maximum of Electron2D.Control.CustomMinimumSize and Electron2D.Control._GetMinimumSize.

Thread Safety

This method is not synchronized. Call it on the main scene thread.

Since

This method is available since Electron2D 0.1.0 Preview.

See Also

  • Electron2D.Control.GetCombinedMinimumSize
  • Electron2D.Control._GetMinimumSize

GetRect()

Kind: Method

public Electron2D.Rect2 GetRect()()

Summary

Gets the local rectangle occupied by this control.

Remarks

The rectangle is computed from anchors and offsets against the current parent layout size.

Returns

A Electron2D.Rect2 containing Electron2D.Control.Position and Electron2D.Control.Size.

Thread Safety

This method is not synchronized. Call it on the main scene thread.

Since

This method is available since Electron2D 0.1.0 Preview.

See Also

  • Electron2D.Control.AnchorLeft
  • Electron2D.Control.GetGlobalRect

GetThemeColor(System.String, System.String)

Kind: Method

public Electron2D.Color GetThemeColor(System.String, System.String)(System.String name, System.String themeType)

Summary

Gets a color from local overrides or inherited themes.

Remarks

Use Electron2D.Control.HasThemeColor(System.String,System.String) to distinguish a missing value from an explicit white value.

Parameters

  • name: The theme color name.
  • themeType: The optional theme type to query before this control's type chain.

Returns

The resolved color, or opaque white when no value exists.

Exceptions

  • System.ArgumentException: Thrown when name is empty.

Thread Safety

This method is not synchronized. Call it on the main scene thread.

Since

This method is available since Electron2D 0.1.0 Preview.

See Also

  • Electron2D.Control.Theme

GetThemeConstant(System.String, System.String)

Kind: Method

public System.Int32 GetThemeConstant(System.String, System.String)(System.String name, System.String themeType)

Summary

Gets an integer theme constant override by name.

Remarks

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.

Parameters

  • name: The theme constant name.
  • themeType: The optional theme type to query before this control's variation and runtime type chain.

Returns

The resolved constant after applying the resolved theme base scale, or 0 when no value exists.

Exceptions

  • System.ArgumentException: Thrown when name is null, empty or whitespace.

Thread Safety

This method is not synchronized. Call it on the main scene thread.

Since

This method is available since Electron2D 0.1.0 Preview.

See Also

  • Electron2D.Control.AddThemeConstantOverride(System.String,System.Int32)
  • Electron2D.Control.GetThemeDefaultBaseScale
  • Electron2D.Control.HasThemeConstant(System.String,System.String)

GetThemeDefaultBaseScale()

Kind: Method

public System.Single GetThemeDefaultBaseScale()()

Summary

Gets the resolved theme base scale.

Remarks

This value is used to scale font sizes and constants resolved by this control.

Returns

The nearest valid theme base scale, or 1 when no theme supplies one.

Thread Safety

This method is not synchronized. Call it on the main scene thread.

Since

This method is available since Electron2D 0.1.0 Preview.

See Also

  • Electron2D.Theme.DefaultBaseScale

GetThemeDefaultFont()

Kind: Method

public Electron2D.Font GetThemeDefaultFont()()

Summary

Gets the resolved default theme font.

Remarks

This value is used as fallback by Electron2D.Control.GetThemeFont(System.String,System.String).

Returns

The nearest default font, or null when no theme supplies one.

Thread Safety

This method is not synchronized. Call it on the main scene thread.

Since

This method is available since Electron2D 0.1.0 Preview.

See Also

  • Electron2D.Theme.DefaultFont

GetThemeDefaultFontSize()

Kind: Method

public System.Int32 GetThemeDefaultFontSize()()

Summary

Gets the resolved default theme font size.

Remarks

This value is used as fallback by Electron2D.Control.GetThemeFontSize(System.String,System.String).

Returns

The scaled nearest default font size, or 16 when no theme supplies one.

Thread Safety

This method is not synchronized. Call it on the main scene thread.

Since

This method is available since Electron2D 0.1.0 Preview.

See Also

  • Electron2D.Theme.DefaultFontSize

GetThemeFont(System.String, System.String)

Kind: Method

public Electron2D.Font GetThemeFont(System.String, System.String)(System.String name, System.String themeType)

Summary

Gets a font from local overrides, inherited themes or the default theme font.

Remarks

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.

Parameters

  • name: The theme font item name.
  • themeType: The optional theme type to query before this control's variation and runtime type chain.

Returns

The resolved font resource, or null when no matching item and no default theme font exist.

Exceptions

  • System.ArgumentException: Thrown when name is null, empty or whitespace.

Thread Safety

This method is not synchronized. Call it on the main scene thread.

Since

This method is available since Electron2D 0.1.0 Preview.

See Also

  • Electron2D.Control.AddThemeFontOverride(System.String,Electron2D.Font)
  • Electron2D.Control.GetThemeDefaultFont
  • Electron2D.Theme.SetFont(System.String,System.String,Electron2D.Font)

GetThemeFontSize(System.String, System.String)

Kind: Method

public System.Int32 GetThemeFontSize(System.String, System.String)(System.String name, System.String themeType)

Summary

Gets a scaled font size from local overrides, inherited themes or fallback values.

Remarks

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.

Parameters

  • name: The theme font size item name.
  • themeType: The optional theme type to query before this control's variation and runtime type chain.

Returns

The resolved font size after applying the resolved theme base scale. The fallback value is 16 before scaling.

Exceptions

  • System.ArgumentException: Thrown when name is null, empty or whitespace.

Thread Safety

This method is not synchronized. Call it on the main scene thread.

Since

This method is available since Electron2D 0.1.0 Preview.

See Also

  • Electron2D.Control.AddThemeFontSizeOverride(System.String,System.Int32)
  • Electron2D.Control.GetThemeDefaultBaseScale
  • Electron2D.Theme.SetFontSize(System.String,System.String,System.Int32)

GetThemeIcon(System.String, System.String)

Kind: Method

public Electron2D.Texture2D GetThemeIcon(System.String, System.String)(System.String name, System.String themeType)

Summary

Gets an icon from local overrides or inherited themes.

Remarks

Icon lookup follows the same branch theme rules as colors and fonts.

Parameters

  • name: The theme icon name.
  • themeType: The optional theme type to query before this control's type chain.

Returns

The resolved icon, or null when no value exists.

Exceptions

  • System.ArgumentException: Thrown when name is empty.

Thread Safety

This method is not synchronized. Call it on the main scene thread.

Since

This method is available since Electron2D 0.1.0 Preview.

See Also

  • Electron2D.Theme.SetIcon(System.String,System.String,Electron2D.Texture2D)

GetThemeStyleBox(System.String, System.String)

Kind: Method

public Electron2D.StyleBox GetThemeStyleBox(System.String, System.String)(System.String name, System.String themeType)

Summary

Gets a style box from local overrides or inherited themes.

Remarks

Style boxes are used by controls that draw themed backgrounds and borders.

Parameters

  • name: The theme style box name.
  • themeType: The optional theme type to query before this control's type chain.

Returns

The resolved style box, or null when no value exists.

Exceptions

  • System.ArgumentException: Thrown when name is empty.

Thread Safety

This method is not synchronized. Call it on the main scene thread.

Since

This method is available since Electron2D 0.1.0 Preview.

See Also

  • Electron2D.StyleBox

GetTooltip(Electron2D.Vector2)

Kind: Method

public System.String GetTooltip(Electron2D.Vector2)(Electron2D.Vector2 atPosition)

Summary

Gets tooltip text for a local pointer position.

Remarks

This method wraps Electron2D.Control._GetTooltip(Electron2D.Vector2) and normalizes a null result to an empty string.

Parameters

  • atPosition: The pointer position in this control's local coordinate space.

Returns

The tooltip text, or an empty string when no tooltip is available.

Thread Safety

This method is not synchronized. Call it on the main scene thread.

Since

This method is available since Electron2D 0.1.0 Preview.

See Also

  • Electron2D.Control.TooltipText
  • Electron2D.Control._MakeCustomTooltip(System.String)

GrabFocus()

Kind: Method

public System.Void GrabFocus()()

Summary

Gives keyboard and gamepad focus to this control.

Remarks

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.

Thread Safety

This method is not synchronized. Call it on the main scene thread.

Since

This method is available since Electron2D 0.1.0 Preview.

See Also

  • Electron2D.Control.FocusMode
  • Electron2D.Control.HasFocus
  • Electron2D.Control.ReleaseFocus

HasFocus()

Kind: Method

public System.Boolean HasFocus()()

Summary

Checks whether this control currently owns focus in its viewport.

Remarks

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.

Returns

true when this control is the focused visible control in its viewport; otherwise, false.

Thread Safety

This method is not synchronized. Call it on the main scene thread.

Since

This method is available since Electron2D 0.1.0 Preview.

See Also

  • Electron2D.Control.GrabFocus
  • Electron2D.Control.ReleaseFocus

HasThemeColor(System.String, System.String)

Kind: Method

public System.Boolean HasThemeColor(System.String, System.String)(System.String name, System.String themeType)

Summary

Reports whether a color can be resolved.

Remarks

This method checks local overrides and inherited themes.

Parameters

  • name: The theme color name.
  • themeType: The optional theme type to query before this control's type chain.

Returns

true when a local or theme color exists; otherwise, false.

Exceptions

  • System.ArgumentException: Thrown when name is empty.

Thread Safety

This method is not synchronized. Call it on the main scene thread.

Since

This method is available since Electron2D 0.1.0 Preview.

See Also

  • Electron2D.Control.GetThemeColor(System.String,System.String)

HasThemeColorOverride(System.String)

Kind: Method

public System.Boolean HasThemeColorOverride(System.String)(System.String name)

Summary

Reports whether this control has a local color override.

Remarks

This method does not inspect assigned theme resources.

Parameters

  • name: The theme color name.

Returns

true when an override exists; otherwise, false.

Exceptions

  • System.ArgumentException: Thrown when name is empty.

Thread Safety

This method is not synchronized. Call it on the main scene thread.

Since

This method is available since Electron2D 0.1.0 Preview.

See Also

  • Electron2D.Control.AddThemeColorOverride(System.String,Electron2D.Color)

HasThemeConstant(System.String, System.String)

Kind: Method

public System.Boolean HasThemeConstant(System.String, System.String)(System.String name, System.String themeType)

Summary

Reports whether a constant can be resolved.

Remarks

This method checks local overrides and inherited themes.

Parameters

  • name: The theme constant name.
  • themeType: The optional theme type to query before this control's type chain.

Returns

true when a local or theme constant exists; otherwise, false.

Exceptions

  • System.ArgumentException: Thrown when name is empty.

Thread Safety

This method is not synchronized. Call it on the main scene thread.

Since

This method is available since Electron2D 0.1.0 Preview.

See Also

  • Electron2D.Control.GetThemeConstant(System.String,System.String)

HasThemeConstantOverride(System.String)

Kind: Method

public System.Boolean HasThemeConstantOverride(System.String)(System.String name)

Summary

Reports whether this control has a theme constant override by name.

Remarks

This method lets container code distinguish a missing value from an explicit zero value.

Parameters

  • name: The theme constant name.

Returns

true when an override exists; otherwise, false.

Exceptions

  • System.ArgumentException: Thrown when name is null, empty or whitespace.

Thread Safety

This method is not synchronized. Call it on the main scene thread.

Since

This method is available since Electron2D 0.1.0 Preview.

See Also

  • Electron2D.Control.AddThemeConstantOverride(System.String,System.Int32)
  • Electron2D.Control.GetThemeConstant(System.String,System.String)

HasThemeFontOverride(System.String)

Kind: Method

public System.Boolean HasThemeFontOverride(System.String)(System.String name)

Summary

Reports whether this control has a local font override.

Remarks

This method does not inspect assigned theme resources.

Parameters

  • name: The theme font name.

Returns

true when an override exists; otherwise, false.

Exceptions

  • System.ArgumentException: Thrown when name is empty.

Thread Safety

This method is not synchronized. Call it on the main scene thread.

Since

This method is available since Electron2D 0.1.0 Preview.

See Also

  • Electron2D.Control.AddThemeFontOverride(System.String,Electron2D.Font)

HasThemeFontSizeOverride(System.String)

Kind: Method

public System.Boolean HasThemeFontSizeOverride(System.String)(System.String name)

Summary

Reports whether this control has a local font size override.

Remarks

This method does not inspect assigned theme resources.

Parameters

  • name: The theme font size name.

Returns

true when an override exists; otherwise, false.

Exceptions

  • System.ArgumentException: Thrown when name is empty.

Thread Safety

This method is not synchronized. Call it on the main scene thread.

Since

This method is available since Electron2D 0.1.0 Preview.

See Also

  • Electron2D.Control.AddThemeFontSizeOverride(System.String,System.Int32)

HasThemeIcon(System.String, System.String)

Kind: Method

public System.Boolean HasThemeIcon(System.String, System.String)(System.String name, System.String themeType)

Summary

Reports whether an icon can be resolved.

Remarks

This method checks local overrides and inherited themes.

Parameters

  • name: The theme icon name.
  • themeType: The optional theme type to query before this control's type chain.

Returns

true when a local or theme icon exists; otherwise, false.

Exceptions

  • System.ArgumentException: Thrown when name is empty.

Thread Safety

This method is not synchronized. Call it on the main scene thread.

Since

This method is available since Electron2D 0.1.0 Preview.

See Also

  • Electron2D.Control.GetThemeIcon(System.String,System.String)

HasThemeIconOverride(System.String)

Kind: Method

public System.Boolean HasThemeIconOverride(System.String)(System.String name)

Summary

Reports whether this control has a local icon override.

Remarks

This method does not inspect assigned theme resources.

Parameters

  • name: The theme icon name.

Returns

true when an override exists; otherwise, false.

Exceptions

  • System.ArgumentException: Thrown when name is empty.

Thread Safety

This method is not synchronized. Call it on the main scene thread.

Since

This method is available since Electron2D 0.1.0 Preview.

See Also

  • Electron2D.Control.AddThemeIconOverride(System.String,Electron2D.Texture2D)

HasThemeStyleBox(System.String, System.String)

Kind: Method

public System.Boolean HasThemeStyleBox(System.String, System.String)(System.String name, System.String themeType)

Summary

Reports whether a style box can be resolved.

Remarks

This method checks local overrides and inherited themes.

Parameters

  • name: The theme style box name.
  • themeType: The optional theme type to query before this control's type chain.

Returns

true when a local or theme style box exists; otherwise, false.

Exceptions

  • System.ArgumentException: Thrown when name is empty.

Thread Safety

This method is not synchronized. Call it on the main scene thread.

Since

This method is available since Electron2D 0.1.0 Preview.

See Also

  • Electron2D.Control.GetThemeStyleBox(System.String,System.String)

HasThemeStyleBoxOverride(System.String)

Kind: Method

public System.Boolean HasThemeStyleBoxOverride(System.String)(System.String name)

Summary

Reports whether this control has a local style box override.

Remarks

This method does not inspect assigned theme resources.

Parameters

  • name: The theme style box name.

Returns

true when an override exists; otherwise, false.

Exceptions

  • System.ArgumentException: Thrown when name is empty.

Thread Safety

This method is not synchronized. Call it on the main scene thread.

Since

This method is available since Electron2D 0.1.0 Preview.

See Also

  • Electron2D.Control.AddThemeStyleBoxOverride(System.String,Electron2D.StyleBox)

ReleaseFocus()

Kind: Method

public System.Void ReleaseFocus()()

Summary

Releases focus from this control when it currently owns it.

Remarks

Calling this method on a control that does not currently own focus is a no-op.

Thread Safety

This method is not synchronized. Call it on the main scene thread.

Since

This method is available since Electron2D 0.1.0 Preview.

See Also

  • Electron2D.Control.GrabFocus
  • Electron2D.Control.HasFocus

RemoveThemeColorOverride(System.String)

Kind: Method

public System.Void RemoveThemeColorOverride(System.String)(System.String name)

Summary

Removes a color theme override from this control.

Remarks

Removing a missing override is a no-op.

Parameters

  • name: The theme color name.

Exceptions

  • System.ArgumentException: Thrown when name is empty.

Thread Safety

This method is not synchronized. Call it on the main scene thread.

Since

This method is available since Electron2D 0.1.0 Preview.

See Also

  • Electron2D.Control.HasThemeColorOverride(System.String)

RemoveThemeConstantOverride(System.String)

Kind: Method

public System.Void RemoveThemeConstantOverride(System.String)(System.String name)

Summary

Removes a constant theme override from this control.

Remarks

Removing a missing override is a no-op.

Parameters

  • name: The theme constant name.

Exceptions

  • System.ArgumentException: Thrown when name is empty.

Thread Safety

This method is not synchronized. Call it on the main scene thread.

Since

This method is available since Electron2D 0.1.0 Preview.

See Also

  • Electron2D.Control.HasThemeConstantOverride(System.String)

RemoveThemeFontOverride(System.String)

Kind: Method

public System.Void RemoveThemeFontOverride(System.String)(System.String name)

Summary

Removes a font theme override from this control.

Remarks

Removing a missing override is a no-op.

Parameters

  • name: The theme font name.

Exceptions

  • System.ArgumentException: Thrown when name is empty.

Thread Safety

This method is not synchronized. Call it on the main scene thread.

Since

This method is available since Electron2D 0.1.0 Preview.

See Also

  • Electron2D.Control.HasThemeFontOverride(System.String)

RemoveThemeFontSizeOverride(System.String)

Kind: Method

public System.Void RemoveThemeFontSizeOverride(System.String)(System.String name)

Summary

Removes a font size theme override from this control.

Remarks

Removing a missing override is a no-op.

Parameters

  • name: The theme font size name.

Exceptions

  • System.ArgumentException: Thrown when name is empty.

Thread Safety

This method is not synchronized. Call it on the main scene thread.

Since

This method is available since Electron2D 0.1.0 Preview.

See Also

  • Electron2D.Control.HasThemeFontSizeOverride(System.String)

RemoveThemeIconOverride(System.String)

Kind: Method

public System.Void RemoveThemeIconOverride(System.String)(System.String name)

Summary

Removes an icon theme override from this control.

Remarks

Removing a missing override is a no-op.

Parameters

  • name: The theme icon name.

Exceptions

  • System.ArgumentException: Thrown when name is empty.

Thread Safety

This method is not synchronized. Call it on the main scene thread.

Since

This method is available since Electron2D 0.1.0 Preview.

See Also

  • Electron2D.Control.HasThemeIconOverride(System.String)

RemoveThemeStyleBoxOverride(System.String)

Kind: Method

public System.Void RemoveThemeStyleBoxOverride(System.String)(System.String name)

Summary

Removes a style box theme override from this control.

Remarks

Removing a missing override is a no-op.

Parameters

  • name: The theme style box name.

Exceptions

  • System.ArgumentException: Thrown when name is empty.

Thread Safety

This method is not synchronized. Call it on the main scene thread.

Since

This method is available since Electron2D 0.1.0 Preview.

See Also

  • Electron2D.Control.HasThemeStyleBoxOverride(System.String)

ResetSize()

Kind: Method

public System.Void ResetSize()()

Summary

Resets this control size to its combined minimum size.

Remarks

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.

Thread Safety

This method is not synchronized. Call it on the main scene thread.

Since

This method is available since Electron2D 0.1.0 Preview.

See Also

  • Electron2D.Control.GetCombinedMinimumSize
  • Electron2D.Control.SetSize(Electron2D.Vector2)

SetSize(Electron2D.Vector2)

Kind: Method

public System.Void SetSize(Electron2D.Vector2)(Electron2D.Vector2 size)

Summary

Sets the computed size of this control.

Remarks

If size is smaller than Electron2D.Control.GetCombinedMinimumSize, this method grows the final rectangle according to Electron2D.Control.GrowHorizontal and Electron2D.Control.GrowVertical.

Parameters

  • size: The requested size in local coordinates.

Exceptions

  • System.ArgumentOutOfRangeException: Thrown when a component of size is negative or not finite.

Thread Safety

This method is not synchronized. Call it on the main scene thread.

Since

This method is available since Electron2D 0.1.0 Preview.

See Also

  • Electron2D.Control.ResetSize
  • Electron2D.Control.Size

_GetMinimumSize()

Kind: Method

public Electron2D.Vector2 _GetMinimumSize()()

Summary

Called to compute the control-specific minimum size.

Remarks

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.

Returns

The minimum size requested by this control implementation.

Thread Safety

This method is not synchronized. It is called on the main scene thread during layout calculations.

Since

This method is available since Electron2D 0.1.0 Preview.

See Also

  • Electron2D.Control.CustomMinimumSize
  • Electron2D.Control.GetMinimumSize

_GetTooltip(Electron2D.Vector2)

Kind: Method

public System.String _GetTooltip(Electron2D.Vector2)(Electron2D.Vector2 atPosition)

Summary

Called to resolve tooltip text for a local pointer position.

Remarks

The base implementation returns Electron2D.Control.TooltipText. Derived controls can return different text for different subregions.

Parameters

  • atPosition: The pointer position in this control's local coordinate space.

Returns

The tooltip text for the position, or an empty string when no tooltip should be shown.

Thread Safety

This method is not synchronized. It is called on the main scene thread.

Since

This method is available since Electron2D 0.1.0 Preview.

See Also

  • Electron2D.Control.GetTooltip(Electron2D.Vector2)
  • Electron2D.Control._MakeCustomTooltip(System.String)

_GuiInput(Electron2D.InputEvent)

Kind: Method

public System.Void _GuiInput(Electron2D.InputEvent)(Electron2D.InputEvent inputEvent)

Summary

Called when a GUI input event is delivered to this control.

Remarks

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.

Parameters

  • inputEvent: The input event delivered by the containing Electron2D.Viewport.

Thread Safety

This method is not synchronized. It is called on the main scene thread during input dispatch.

Since

This method is available since Electron2D 0.1.0 Preview.

See Also

  • Electron2D.Control.AcceptEvent
  • Electron2D.Control.FocusMode
  • Electron2D.Control.MouseFilter

_MakeCustomTooltip(System.String)

Kind: Method

public Electron2D.Control _MakeCustomTooltip(System.String)(System.String forText)

Summary

Called to create a custom tooltip control for resolved text.

Remarks

The base implementation returns null. Callers that show tooltip visuals own the returned control's lifetime.

Parameters

  • forText: The tooltip text returned by Electron2D.Control.GetTooltip(Electron2D.Vector2).

Returns

A control used as a custom tooltip, or null to use the default tooltip presentation.

Thread Safety

This method is not synchronized. It is called on the main scene thread.

Since

This method is available since Electron2D 0.1.0 Preview.

See Also

  • Electron2D.Control.GetTooltip(Electron2D.Vector2)

Clone this wiki locally