Class Toggle
Assembly: PopcorningGuineaPig.Engine.dll
Syntax
public class Toggle : InteractiveUIElement, IUIElement
Constructors
|
Edit this page
View Source
Toggle(Vector2, Vector2, bool, string)
Declaration
public Toggle(Vector2 position, Vector2 size, bool initialValue = false, string labelText = "")
Parameters
Properties
|
Edit this page
View Source
IsOn
Declaration
public bool IsOn { get; set; }
Property Value
Methods
|
Edit this page
View Source
DrawSelf()
Override DrawSelf to handle label drawing
Derived classes should call base.DrawSelf() to ensure labels are drawn
Declaration
protected override void DrawSelf()
Overrides
|
Edit this page
View Source
GetValue()
Declaration
Returns
|
Edit this page
View Source
SetColors(Color, Color, Color, Color)
Declaration
public void SetColors(Color backgroundColor, Color toggledColor, Color knobColor, Color borderColor)
Parameters
| Type |
Name |
Description |
| Color |
backgroundColor |
|
| Color |
toggledColor |
|
| Color |
knobColor |
|
| Color |
borderColor |
|
|
Edit this page
View Source
SetLocalizationService(ILocalizationService?)
Sets the localization service to use for automatic font management.
This forwards the service to the internal label if present.
Declaration
public override void SetLocalizationService(ILocalizationService? localizationService)
Parameters
Overrides
|
Edit this page
View Source
SetOnToggleChanged(Action<bool>)
Declaration
public void SetOnToggleChanged(Action<bool> callback)
Parameters
|
Edit this page
View Source
SetValue(bool)
Declaration
public void SetValue(bool value)
Parameters
| Type |
Name |
Description |
| bool |
value |
|
|
Edit this page
View Source
UpdateSelf()
Override UpdateSelf to provide common interactive element functionality
Derived classes should call base.UpdateSelf() before their own update logic
Declaration
protected override void UpdateSelf()
Overrides
Implements