-
Notifications
You must be signed in to change notification settings - Fork 0
TextureButton
Home | API by Category | Complete API Index | API Compatibility
| Field | Value |
|---|---|
| Full name | Electron2D.TextureButton |
| Namespace | Electron2D |
| Kind | class |
| Category | UI and Text |
Provides a button that draws textures for its visual states.
public class Electron2D.TextureButton : Electron2D.BaseButtonProfile: Electron2D 0.1.0 2D
Status: Supported / Parity verified
Out of profile: no
Godot reference: TextureButton
Texture-state button with normal, pressed, hover, disabled, focused and click-mask texture properties plus stretch mode.
TextureButton uses Electron2D.BaseButton input and signals, then
selects a texture for normal, pressed, disabled and focused states.
This type is not synchronized. Create and mutate texture buttons on the main scene thread.
This type is available since Electron2D 0.1.0 Preview.
Electron2D.BaseButtonElectron2D.Texture2D
| Member | Kind | Summary |
|---|---|---|
IgnoreTextureSize |
Property | Gets or sets whether the texture size is ignored for minimum-size calculation. |
StretchMode |
Property | Gets or sets how the selected texture is drawn. |
TextureClickMask |
Property | Gets or sets the optional click-mask texture. |
TextureDisabled |
Property | Gets or sets the disabled-state texture. |
TextureFocused |
Property | Gets or sets the focus overlay texture. |
TextureHover |
Property | Gets or sets the hover-state texture. |
TextureNormal |
Property | Gets or sets the default texture. |
TexturePressed |
Property | Gets or sets the pressed-state texture. |
Electron2D.TextureButton() |
Constructor | Initializes a new instance of the Electron2D.TextureButton class. |
_Draw() |
Method | Draws the selected texture for the current button state. |
_GetMinimumSize() |
Method | Gets the minimum size requested by this texture button. |
Kind: Property
public System.Boolean IgnoreTextureSize { get; set; }Gets or sets whether the texture size is ignored for minimum-size calculation.
This property does not affect drawing, only Electron2D.TextureButton._GetMinimumSize.
true to return zero texture minimum size; 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.TextureButton._GetMinimumSize
Kind: Property
public Electron2D.TextureButton.StretchModeEnum StretchMode { get; set; }Gets or sets how the selected texture is drawn.
The default is Electron2D.TextureButton.StretchModeEnum.Scale.
The stretch mode used by Electron2D.TextureButton._Draw.
This property is not synchronized. Mutate it on the main scene thread.
This property is available since Electron2D 0.1.0 Preview.
Electron2D.TextureButton.StretchModeEnum
Kind: Property
public Electron2D.Texture2D TextureClickMask { get; set; }Gets or sets the optional click-mask texture.
The preview stores this resource for API compatibility; rectangular hit testing remains active.
The texture reserved for opaque-pixel hit testing.
This property is not synchronized. Mutate it on the main scene thread.
This property is available since Electron2D 0.1.0 Preview.
Electron2D.Texture2D.IsPixelOpaque(System.Int32,System.Int32)
Kind: Property
public Electron2D.Texture2D TextureDisabled { get; set; }Gets or sets the disabled-state texture.
If this value is null, Electron2D.TextureButton.TextureNormal is used.
The texture used when Electron2D.BaseButton.Disabled is true.
This property is not synchronized. Mutate it on the main scene thread.
This property is available since Electron2D 0.1.0 Preview.
Electron2D.BaseButton.Disabled
Kind: Property
public Electron2D.Texture2D TextureFocused { get; set; }Gets or sets the focus overlay texture.
Set this to null to skip focus overlay drawing.
The texture drawn after the state texture when the button has focus.
This property is not synchronized. Mutate it on the main scene thread.
This property is available since Electron2D 0.1.0 Preview.
Electron2D.Control.HasFocus
Kind: Property
public Electron2D.Texture2D TextureHover { get; set; }Gets or sets the hover-state texture.
Pointer hover tracking is not exposed as public state in this preview.
The texture reserved for hover rendering.
This property is not synchronized. Mutate it on the main scene thread.
This property is available since Electron2D 0.1.0 Preview.
Electron2D.TextureButton.TextureNormal
Kind: Property
public Electron2D.Texture2D TextureNormal { get; set; }Gets or sets the default texture.
Assigning this property queues a redraw.
The texture used when no more specific state texture applies.
This property is not synchronized. Mutate it on the main scene thread.
This property is available since Electron2D 0.1.0 Preview.
Electron2D.Texture2D
Kind: Property
public Electron2D.Texture2D TexturePressed { get; set; }Gets or sets the pressed-state texture.
If this value is null, Electron2D.TextureButton.TextureNormal is used.
The texture used when the button is pressed.
This property is not synchronized. Mutate it on the main scene thread.
This property is available since Electron2D 0.1.0 Preview.
Electron2D.TextureButton.TextureNormal
Kind: Constructor
public Electron2D.TextureButton()Initializes a new instance of the Electron2D.TextureButton class.
The new texture button uses scale drawing until
Electron2D.TextureButton.StretchMode is changed.
This constructor is not synchronized. Call it from the main scene thread.
This constructor is available since Electron2D 0.1.0 Preview.
Electron2D.TextureButton
Kind: Method
public System.Void _Draw()()Draws the selected texture for the current button state.
The focus texture, when set, is drawn after the state texture.
This callback is invoked on the main scene thread.
This method is available since Electron2D 0.1.0 Preview.
Electron2D.TextureButton.TextureNormal
Kind: Method
public Electron2D.Vector2 _GetMinimumSize()()Gets the minimum size requested by this texture button.
The pressed/disabled/focus textures do not change minimum size.
The normal texture size, or Electron2D.Vector2.Zero when no texture is available or size is ignored.
This callback is invoked on the main scene thread.
This method is available since Electron2D 0.1.0 Preview.
Electron2D.TextureButton.TextureNormal
Electron2D 0.1.0 Preview API reference. Generated from 175 public runtime types.