Popcorning Guinea Pig
Search Results for

    Show / Hide Table of Contents

    Class InteractiveUIElement

    Base class for UI elements that support user interaction Extends UIElementBase with IsEnabled functionality and optional label support

    Inheritance
    object
    UIElementBase
    InteractiveUIElement
    Button
    Dropdown<T>
    Link
    ListBox<T>
    Slider
    TabControl
    Text
    Toggle
    Implements
    IUIElement
    Inherited Members
    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.SetLocalizationService(ILocalizationService)
    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 abstract class InteractiveUIElement : UIElementBase, IUIElement

    Properties

    | Edit this page View Source

    HasLabel

    Gets whether this element has a label

    Declaration
    public bool HasLabel { get; }
    Property Value
    Type Description
    bool
    | Edit this page View Source

    IsEnabled

    Protected property that controls whether this element can be interacted with

    Declaration
    protected bool IsEnabled { get; }
    Property Value
    Type Description
    bool
    | Edit this page View Source

    LabelPosition

    Gets the current label position for this interactive element

    Declaration
    public LabelPosition LabelPosition { get; }
    Property Value
    Type Description
    LabelPosition
    | Edit this page View Source

    LabelSpacing

    Gets the label spacing

    Declaration
    public float LabelSpacing { get; }
    Property Value
    Type Description
    float

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

    GetEnabled()

    Gets whether this interactive element is currently enabled

    Declaration
    public bool GetEnabled()
    Returns
    Type Description
    bool

    True if enabled, false if disabled

    | Edit this page View Source

    GetLabelOffset()

    Gets the offset that should be applied to the control position to account for label placement. This offset is the amount the control needs to move from the top-left of its bounding box.

    Declaration
    public Vector2 GetLabelOffset()
    Returns
    Type Description
    Vector2
    | Edit this page View Source

    GetLabelText()

    Gets the current label text, or null if no label is set

    Declaration
    public string? GetLabelText()
    Returns
    Type Description
    string
    | Edit this page View Source

    GetTotalSizeWithLabel()

    Gets the total size of this element including its label (if any)

    Declaration
    public Vector2 GetTotalSizeWithLabel()
    Returns
    Type Description
    Vector2
    | Edit this page View Source

    RemoveLabel()

    Removes the label from this interactive element

    Declaration
    public virtual void RemoveLabel()
    | Edit this page View Source

    SetEnabled(bool)

    Sets whether this interactive element is enabled for user interaction

    Declaration
    public virtual void SetEnabled(bool enabled)
    Parameters
    Type Name Description
    bool enabled

    True to enable interaction, false to disable

    | Edit this page View Source

    SetLabel(string, LabelPosition, float)

    Sets a label for this interactive element

    Declaration
    public virtual void SetLabel(string text, LabelPosition position = LabelPosition.Left, float spacing = 5)
    Parameters
    Type Name Description
    string text

    The label text

    LabelPosition position

    The position of the label relative to the control

    float spacing

    Spacing between label and control

    | Edit this page View Source

    SetLabelLocalization(ILocalizationService?, string, string?)

    Sets localization on this element's label

    Declaration
    public void SetLabelLocalization(ILocalizationService? localizationService, string localizationKey, string? fallbackText = null)
    Parameters
    Type Name Description
    ILocalizationService localizationService
    string localizationKey
    string fallbackText
    | 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
    UIElementBase.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.