Class · inherits Instance
PluginToolbarButton
A button on a PluginToolbar in the Studio ribbon, created by
PluginToolbar.CreateButton, that fires
Click when pressed.
About PluginToolbarButton
A PluginToolbarButton object is created through the
PluginToolbar.CreateButton function. It allows the user to initiate
a single, one-off action in Roblox Studio through the
Click event. Toolbar buttons can also be
assigned a keyboard shortcut through Studio's File ⟩ Customize
Shortcuts window.
When pressed, the Click event fires. A
button will also remain in the pressed state, which may be set manually using
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
Enabled property were false. Disabled
buttons are desaturated and do not respond to user clicks. By setting
ClickableWhenViewportHidden
to true, you can allow plugin buttons to remain clickable, such as during
script editing.
Properties 4
ClickableWhenViewportHidden
: booleanNotReplicatedDetermines whether the button can be clicked when the 3D viewport is hidden, such as when aScriptis being edited in another tab.This property determines whether a
PluginToolbarButtonmay be clicked while the 3D viewport is hidden, such as when aScriptis being edited in another tab.Typically, this property should be enabled if an action triggered by a plugin button's
Clickevent doesn't occur in the 3D world (Workspace). For example, a button that opens a widget should have this property astrue, since showing a widget is visible to the user even if the 3D view isn't visible.Enabled
: booleanNotReplicatedDetermines whether the button is clickable in general.This property determines whether a button is clickable in general. When
false, the button will be greyed out and unclickable, preventing the user from firing theClickevent. Buttons are enabled by default.When re-enabling this property, the plugin button's state won't be remembered from the previous state in which the user left the button in. Instead, it will default to the last state set by
SetActive()or to the inactive state ifSetActive()was never used.Plugins should disable their buttons when the button action isn't relevant in the current context. For example, a plugin button that assigns random colors to selected should not be enabled when the selection contains no parts.
See also
ClickableWhenViewportHiddenwhich determines whether a button is clickable when the game view is hidden (and not just in general).Icon
: ContentIdNotReplicatedDetermines what icon should represent the button.This property determines which
Contentshould be shown for the button's icon in the toolbar. When this property is not set, the button will instead use the button's text given byPluginToolbar.CreateButton.IconContent
: ContentPluginNotReplicatedThe content of the image used as the button's icon in the toolbar. Only supports asset URIs.This property sets the image content displayed as the button's icon in the plugin toolbar. When this property is not set, the button instead displays the text label provided when calling
PluginToolbar.CreateButton. Only asset URIs are supported for this property.
Methods 1
SetActive
(active: boolean) → ()PluginSets the state of the plugin button.This method can be used to manually set the active state of the plugin button.
When the
Enabledproperty is toggled back on, the button will either revert to the last state set by this method or default to inactive if this method hasn't been used previously.
Events 1
Click
PluginToolbarButton.Click:Connect(function())PluginFires when the user presses and releases their cursor on the button.This event fires when the
PluginToolbarButtonis pressed and released by the user.See also
SetActive()to manually set the state of the button.
PluginToolbarButton also has every member of Instance. Deprecated and Roblox-only members are hidden.
Reference text from the Roblox Creator Documentation, licensed CC BY 4.0, reorganized by rbxtoolshub.com · Studio 0.743.0.7431133.