Table of Contents

Class LabelButton

Namespace
RichHudFramework.UI
Assembly
RichHudClient.dll

Clickable text element. Text only, no background.

No styling by default; it's just a clickable Label with no highlighting.

public class LabelButton : Label, IReadOnlyHudElement, IReadOnlyHudNode, IReadOnlyHudParent, IMinLabelElement, IClickableElement, IFocusableElement
Inheritance
LabelButton
Implements
Inherited Members

Examples

var btn = new LabelButton(parent)
{
    // Fancy serifed font
    Format = GlyphFormat.White.WithFont("AbhayaLibreMedium"),
    // Set label text
    Text = "Clickable label, no background",
    MouseInput = 
    {
        // Custom tooltip constructed from a string using default formatting
        ToolTip = "This font doesn't look out of place at all!",
        // Add callback invoked on click
        LeftClickedCallback = (obj, args) => MyAPIGateway.Utilities.ShowMessage(
            $"[{obj.GetType().Name}]", // Print button type name
            "You'll see this chat message when the button is clicked.")
    }
};

Constructors

LabelButton()

public LabelButton()

LabelButton(HudParentBase)

public LabelButton(HudParentBase parent)

Parameters

parent HudParentBase

Properties

FocusHandler

Interface for managing gaining/losing input focus

public IFocusHandler FocusHandler { get; }

Property Value

IFocusHandler

IsMousedOver

Indicates whether or not the cursor is currently positioned over the button.

public override bool IsMousedOver { get; }

Property Value

bool

MouseInput

Handles mouse input for the button.

public IMouseInput MouseInput { get; }

Property Value

IMouseInput