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!
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:
1
2
3
4
5
6
7
localfunctionsaveWork()-- Save the user's work here.endpluginGui:BindToClose(function()saveWork()end)
Call BindToClose() without an argument to unbind the current function:
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.
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.
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.
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 afterUserInputService.WindowFocused.
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.