UIButton
public sealed class UIButton : UINode
Namespace: DeadworksManaged.Api.UI
Inherits / implements: UINode
Source: UI/UILayout.cs#L71
Fields
UIButton.Text
Signature
public string Text = "";
Source: UI/UILayout.cs#L72
UIButton.ClickEvent
Signature
public string? ClickEvent;
Source: UI/UILayout.cs#L73
UIButton.ClickArgs
Signature
public string[] ClickArgs;
Source: UI/UILayout.cs#L74
Methods
UIButton.TextLabel()
The Label carrying this button's text, created on first use.
A Button with text and no children has its Label created client-side, where a plugin cannot reach it to apply styles. Asking for the label here moves the text into a real child node instead, which then styles like any other. Idempotent, so repeated calls keep returning the same Label.
Signature
public UILabel TextLabel()
Source: UI/UILayout.cs#L86
UIButton.OnClick()
Name the event this button fires, and any arguments to send with it. Handle it with UI.Panel(id).On(eventName, ...).
Signature
public UIButton OnClick(string eventName, params string[] args)
Source: UI/UILayout.cs#L98
UIButton.CopyOnClick()
Make clicking this button copy text to the player's clipboard, such as a link to share. The copy happens in the player's game: no event reaches the plugin. Replaces any OnClick event.
Signature
public UIButton CopyOnClick(string text)
Source: UI/UILayout.cs#L108