Table of Contents

Class BorderedButton

Namespace
RichHudFramework.UI
Assembly
RichHudClient.dll

LabelBoxButton styled to closely match the appearance of buttons in the SE terminal.

Formatting temporarily changes when it gains input focus.

public class BorderedButton : LabelBoxButton, IReadOnlyHudElement, IReadOnlyHudNode, IReadOnlyHudParent, ILabelElement, IMinLabelElement, IClickableElement, IFocusableElement
Inheritance
BorderedButton
Implements
Inherited Members

Examples

This example creates a button with a border, very similar in appearance to those found in Space Engineer's terminal, but with a bright orange tooltip and an exceptionally garish pink-purple focus format, because why not?

By default, the focus formatting matches the default Space Engineers behavior: light blue background with dark text.

var btn = new BorderedButton(parent)
{
    Text = "Send Chat Message",
    BorderColor = Color.Green, // Your button / your rules
    // This is going to really pop when you click it
    FocusTextColor = Color.LightPink,
    FocusColor = Color.Purple,
    MouseInput =
    {
        // Custom tooltip constructed from RichText with custom background
        ToolTip = new ToolTip 
        {
            text = "This is a bright orange warning tooltip.",
            bgColor = Color.OrangeRed
        },
        // 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

BorderedButton()

public BorderedButton()

BorderedButton(HudParentBase)

public BorderedButton(HudParentBase parent)

Parameters

parent HudParentBase

Properties

BorderColor

Color of the border surrounding the button

public Color BorderColor { get; set; }

Property Value

Color

BorderThickness

Thickness of the border surrounding the button

public float BorderThickness { get; set; }

Property Value

float

FocusColor

Background color used when the control gains focus.

public Color FocusColor { get; set; }

Property Value

Color

FocusTextColor

Text color used when the control gains focus.

public Color FocusTextColor { get; set; }

Property Value

Color

HighlightColor

Background highlight color

public override Color HighlightColor { get; set; }

Property Value

Color

UseFocusFormatting

If true, then the button will change formatting when it takes focus. Enabled by default.

public bool UseFocusFormatting { get; set; }

Property Value

bool