PcoWSkbVqDnWTu_dm2ix
We use cookies on this site to enhance your user experience
Collapse Sidebar

PluginToolbarButton

Show deprecated

PluginToolbarButton

Show deprecated

A PluginToolbarButton is an object created by the PluginToolbar/CreateButton function. It allows the user to initiate a single, one-off action in Roblox Studio through the PluginToolbarButton/Click|Click event. Pictured below are three PluginToolbarButtons. From left to right: the default, hover and pressed states. The hovered button in the center shows tooltip text, which is the 2nd argument passed to PluginToolbar/CreateButton.

Three PluginToolbarButtons rendered on a PluginToolbar titled "Three Wise Monkeys"

Behavior

When pressed, the PluginToolbarButton/Click|Click event fires. A button will also remain in the pressed state, which may be set manually using PluginToolbarButton/SetActive|SetActive. Upon plugin activation (Plugin/Activate), buttons in all other PluginToolbars will be toggled off. If all buttons in a toolbar are off, the toolbar’s plugin is deactivated (Plugin/Deactivate).

When the game viewport is not visible, buttons will be disabled as if their PluginToolbarButton/Enabled|Enabled property were false. Disabled buttons are desaturated and do not respond to user clicks. By setting PluginToolbarButton/ClickableWhenViewportHidden|ClickableWhenViewportHidden to true, you can allow plugin buttons to remain clickable (such as during script editing).

History

  • Prior to an update released in January 2019, this class was simply known as “Button”. This was changed to reduce confusion with similarly named in-game UI element classes, such as TextButton.

Properties

bool

ClickableWhenViewportHidden

[NotReplicated]
bool

Enabled

[NotReplicated]
Content

Icon

[NotReplicated]

Functions

void

SetActive ( bool active )

Events

RBXScriptSignal

Click ( )