Popcorning Guinea Pig
Search Results for

    Show / Hide Table of Contents

    Class Toggle

    Inheritance
    object
    UIElementBase
    InteractiveUIElement
    Toggle
    Implements
    IUIElement
    Inherited Members
    InteractiveUIElement.IsEnabled
    InteractiveUIElement.LabelPosition
    InteractiveUIElement.HasLabel
    InteractiveUIElement.LabelSpacing
    InteractiveUIElement.GetTotalSizeWithLabel()
    InteractiveUIElement.GetLabelOffset()
    InteractiveUIElement.SetEnabled(bool)
    InteractiveUIElement.GetEnabled()
    InteractiveUIElement.SetLabel(string, LabelPosition, float)
    InteractiveUIElement.SetLabelLocalization(ILocalizationService, string, string)
    InteractiveUIElement.RemoveLabel()
    InteractiveUIElement.GetLabelText()
    UIElementBase._children
    UIElementBase.Tooltip
    UIElementBase.TooltipLocalizationKey
    UIElementBase.TooltipFallbackText
    UIElementBase.Id
    UIElementBase.Position
    UIElementBase.Size
    UIElementBase.Visible
    UIElementBase.Opacity
    UIElementBase.Parent
    UIElementBase.Children
    UIElementBase.AddChild(IUIElement)
    UIElementBase.RemoveChild(IUIElement)
    UIElementBase.RemoveFromParent()
    UIElementBase.GetWorldPosition()
    UIElementBase.GetLocalPosition()
    UIElementBase.Update()
    UIElementBase.Draw()
    UIElementBase.SetTooltip(string)
    UIElementBase.SetTooltipLocalizationKey(string, string)
    UIElementBase.UpdateTooltipFromLocalization()
    UIElementBase.SetTooltipText(string)
    UIElementBase.IsMouseOver()
    object.Equals(object)
    object.Equals(object, object)
    object.GetHashCode()
    object.GetType()
    object.MemberwiseClone()
    object.ReferenceEquals(object, object)
    object.ToString()
    Namespace: PopcorningGuineaPig.Engine.UI
    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
    Type Name Description
    Vector2 position
    Vector2 size
    bool initialValue
    string labelText

    Properties

    | Edit this page View Source

    IsOn

    Declaration
    public bool IsOn { get; set; }
    Property Value
    Type Description
    bool

    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
    InteractiveUIElement.DrawSelf()
    | Edit this page View Source

    GetValue()

    Declaration
    public bool GetValue()
    Returns
    Type Description
    bool
    | 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
    Type Name Description
    ILocalizationService localizationService
    Overrides
    UIElementBase.SetLocalizationService(ILocalizationService?)
    | Edit this page View Source

    SetOnToggleChanged(Action<bool>)

    Declaration
    public void SetOnToggleChanged(Action<bool> callback)
    Parameters
    Type Name Description
    Action<bool> callback
    | 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
    InteractiveUIElement.UpdateSelf()

    Implements

    IUIElement
    • Edit this page
    • View Source
    In this article
    Back to top © 2024 Popcorning Guinea Pig Game Engine. A custom C# game engine for indie developers.