Roblox UtilitiesDevlHub Roblox Documentation

Class

PluginGui

NotCreatableNotReplicated
Memory category
Instances
Subclasses
1

An abstract base class for GUIs that display GuiObjects in Roblox Studio widgets.

PluginGui is an abstract class for GUIs that allow the display of GuiObjects in various Roblox Studio widgets. As of right now, the only available PluginGui type is DockWidgetPluginGui, but there may be more in the future!

Properties 1#

TitlestringThe title that is displayed above the contents of the PluginGui.ReadSafe

Title: string#

ReadSafe

The title that is displayed above the contents of the PluginGui. Defaults to empty string.

Methods 2#

BindToCloseBinds a function that runs when the user closes the PluginGui.
GetRelativeMousePositionReturns the position of the mouse relative to the PluginGui.PluginSecurity security

BindToClose(function: Function = nil): ()#

This method binds a function that runs when the user clicks the close button of the PluginGui. The widget closes and its Enabled property becomes false even when a function is bound, so the function can't prevent or delay closing. Use it to perform tasks such as saving work when the widget closes.

For example, the following code saves work when the user closes the widget:

Luau
local function saveWork()
	-- Save the user's work here.
end

pluginGui:BindToClose(function()
	saveWork()
end)

Call BindToClose() without an argument to unbind the current function:

Luau
pluginGui:BindToClose()

See also:

NameTypeDefaultDescription
functionFunctionnilThe function to bind the close button to. If no function is specified then any previously specified function will be unbound.
Returns
  • ()

GetRelativeMousePosition(): Vector2#

PluginSecurity security

GetRelativeMousePosition returns the position of the mouse relative to the top-left corner of the PluginGui. The returned value changes only if a mouse input began on the PluginGui, or if the mouse is presently hovering over the window.

Returns
  • Vector2 — The screen position of the mouse relative to the PluginGui in pixels.

Events 6#

PluginDragDroppedFires when the user releases their mouse when hovering over a PluginGui during a drag operation started by Plugin:StartDrag().PluginSecurity security
PluginDragEnteredFires when the user's mouse enters a PluginGui during a drag operation started by Plugin:StartDrag().PluginSecurity security
PluginDragLeftFires when the user's mouse leaves a PluginGui during a drag operation started by Plugin:StartDrag().PluginSecurity security
PluginDragMovedFires when the user's mouse moves within a PluginGui during a drag operation started by Plugin:StartDrag().PluginSecurity security
WindowFocusedFires when the user begins interacting with the window of the PluginGui.PluginSecurity security
WindowFocusReleasedFires when the user stops interacting with the window of the PluginGui.PluginSecurity security

PluginDragDropped(dragData: Dictionary)#

PluginSecurity security

PluginDragDropped fires when the user releases their mouse over a PluginGui during a drag operation started by Plugin:StartDrag().

See also:

NameTypeDefaultDescription
dragDataDictionaryA copy of the data originally passed to Plugin:StartDrag().

PluginDragEntered(dragData: Dictionary)#

PluginSecurity security

PluginDragEntered fires when the user's mouse enters the PluginGui during a drag operation started by Plugin:StartDrag().

This event is useful for displaying a "Drop Here" UI on PluginGuis where a drag operation can be dropped. Such a UI should be hidden when either PluginDragLeft or PluginDragDropped fire.

See also:

NameTypeDefaultDescription
dragDataDictionaryA copy of the data originally passed to Plugin:StartDrag().

PluginDragLeft(dragData: Dictionary)#

PluginSecurity security

PluginDragLeft fires when the user's mouse leaves a PluginGui during a drag operation started by Plugin:StartDrag().

This event and PluginDragDropped are useful for hiding a "Drop Here" UI on PluginGuis where a drag operation can be dropped. Such a UI should be shown when either PluginDragEntered fires.

See also:

NameTypeDefaultDescription
dragDataDictionaryA copy of the data originally passed to Plugin:StartDrag().

PluginDragMoved(dragData: Dictionary)#

PluginSecurity security

PluginDragMoved fires when the user's mouse moves within a PluginGui during a drag operation started by Plugin:StartDrag().

See also:

NameTypeDefaultDescription
dragDataDictionaryA copy of the data originally passed to Plugin:StartDrag().

WindowFocused()#

PluginSecurity security

WindowFocused fires immediately when the user starts interacting with the PluginGui's window, usually by clicking on it. This functions works similarly to the similarly-named UserInputService.WindowFocused event. It fires before any GuiObject.InputBegan events related to mouse buttons.

If another PluginGui is in focus and the user focuses this PluginGui, then this event fires after the other's WindowFocusReleased event. However, if the main game window was in focus, this event fires after UserInputService.WindowFocusReleased.

WindowFocusReleased()#

PluginSecurity security

WindowFocusReleased fires immediately when the user stops interacting with the PluginGui's window, usually by clicking on something not in the window. This functions works similarly to the similarly-named UserInputService.WindowFocusReleased event.

If focus is moving to another PluginGui while the user had this PluginGui in focus, then this event fires before the other's WindowFocused event. However, if the main game window is being put in focus, this event fires after UserInputService.WindowFocused.

Inherited members#

Inherited from LayerCollector 4
Inherited from GuiBase2d 12
Inherited from Instance 58
Inherited from Object 6
Properties (2)

ClassName, className

Events (1)

Changed

Subclasses 1#