PluginGui
Memory category | Instances |
---|
Member index 14
Removed member index 1
History | Member | |
---|---|---|
349 | HostWidgetWasRestored: bool |
Description
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!
History 41
- 651 Add MouseLeave
- 651 Add MouseEnter
- 651 Add InputEnded
- 651 Add InputChanged
- 651 Add InputBegan
- 573 Change ReturnType of BindToClose from void to null
- 553 Change Default of Title from to
- 486 Change ThreadSafety of Title from ReadOnly to ReadSafe
- 462 Change ThreadSafety of WindowFocused from to Unsafe
- 462 Change ThreadSafety of WindowFocusReleased from to Unsafe
- 462 Change ThreadSafety of PluginDragMoved from to Unsafe
- 462 Change ThreadSafety of PluginDragLeft from to Unsafe
- 462 Change ThreadSafety of PluginDragEntered from to Unsafe
- 462 Change ThreadSafety of PluginDragDropped from to Unsafe
- 462 Change ThreadSafety of GetRelativeMousePosition from to Unsafe
- 462 Change ThreadSafety of BindToClose from to Unsafe
- 462 Change ThreadSafety of Title from to ReadOnly
- 366 Change Parameters of PluginDragMoved from (pluginDragEvent: Instance) to (dragData: Dictionary)
- 366 Change Security of PluginDragMoved from RobloxScriptSecurity to PluginSecurity
- 366 Change Parameters of PluginDragLeft from (pluginDragEvent: Instance) to (dragData: Dictionary)
- 366 Change Security of PluginDragLeft from RobloxScriptSecurity to PluginSecurity
- 366 Change Parameters of PluginDragEntered from (pluginDragEvent: Instance) to (dragData: Dictionary)
- 366 Change Security of PluginDragEntered from RobloxScriptSecurity to PluginSecurity
- 366 Change Security of PluginDragDropped from RobloxScriptSecurity to PluginSecurity
- 366 Change Parameters of PluginDragDropped from (pluginDragEvent: Instance) to (dragData: Dictionary)
- 354 Add WindowFocused
- 354 Add WindowFocusReleased
- 354 Add PluginDragMoved
- 354 Add PluginDragLeft
- 354 Add PluginDragEntered
- 354 Add PluginDragDropped
- 352 Add GetRelativeMousePosition
- 352 Add BindToClose
- 349 Remove WindowFocused
- 349 Remove WindowFocusReleased
- 349 Remove HostWidgetWasRestored
- 338 Add WindowFocused
- 338 Add WindowFocusReleased
- 327 Add Title
- 326 Add HostWidgetWasRestored
- 319 Add PluginGui
Members 14
BindToClose
Parameters (1) | Default | |
---|---|---|
function | Function | nil |
Returns (1) | ||
null |
This function binds a function to the PluginGui close button, overriding the default behavior.
By default, when the user clicks the 'x' button in the top right corner of the PluginGui the Enabled property is set to false, closing the window. When a custom function is bound using BindToClose this behavior is overwritten, allowing you to check if the user really wants to close the window or give them an opportunity to save their work.
As the default closing behavior is overwritten by this function, you'll need to configure the PluginGui to close manually by setting PluginGui.Enabled to false. For example, in the below snippet users are required to click a confirm button to close the GUI:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 |
|
You can call BindToClose with no argument to 'unbind' and revert to the default behavior described above. For example:
1
|
|
See also:
- Plugin:CreateDockWidgetPluginGui() to create a PluginGui
- DataModel:BindToClose(), which can be used to bind a function to the game ending and should not be confused with this function
Thread safety | Unsafe |
---|
History 3
- 573 Change ReturnType of BindToClose from void to null
- 462 Change ThreadSafety of BindToClose from to Unsafe
- 352 Add BindToClose
GetRelativeMousePosition
Parameters (0) | ||
---|---|---|
No parameters. | ||
Returns (1) | ||
Vector2 |
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.
Security | PluginSecurity |
---|---|
Thread safety | Unsafe |
History 2
- 462 Change ThreadSafety of GetRelativeMousePosition from to Unsafe
- 352 Add GetRelativeMousePosition
InputBegan
Parameters (2) | |
---|---|
input | InputObject |
gameProcessedEvent | bool |
Security | RobloxScriptSecurity |
---|---|
Thread safety | Unsafe |
History 1
- 651 Add InputBegan
InputChanged
Parameters (2) | |
---|---|
input | InputObject |
gameProcessedEvent | bool |
Security | RobloxScriptSecurity |
---|---|
Thread safety | Unsafe |
History 1
- 651 Add InputChanged
InputEnded
Parameters (2) | |
---|---|
input | InputObject |
gameProcessedEvent | bool |
Security | RobloxScriptSecurity |
---|---|
Thread safety | Unsafe |
History 1
- 651 Add InputEnded
MouseEnter
Parameters (0) | ||
---|---|---|
No parameters. |
Security | RobloxScriptSecurity |
---|---|
Thread safety | Unsafe |
History 1
- 651 Add MouseEnter
MouseLeave
Parameters (0) | ||
---|---|---|
No parameters. |
Security | RobloxScriptSecurity |
---|---|
Thread safety | Unsafe |
History 1
- 651 Add MouseLeave
PluginDragDropped
Parameters (1) | |
---|---|
dragData | Dictionary |
PluginDragDropped fires when the user releases their mouse over a PluginGui during a drag operation started by Plugin:StartDrag().
See also:
Security | PluginSecurity |
---|---|
Thread safety | Unsafe |
History 4
- 462 Change ThreadSafety of PluginDragDropped from to Unsafe
- 366 Change Security of PluginDragDropped from RobloxScriptSecurity to PluginSecurity
- 366 Change Parameters of PluginDragDropped from (pluginDragEvent: Instance) to (dragData: Dictionary)
- 354 Add PluginDragDropped
PluginDragEntered
Parameters (1) | |
---|---|
dragData | Dictionary |
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:
Security | PluginSecurity |
---|---|
Thread safety | Unsafe |
History 4
- 462 Change ThreadSafety of PluginDragEntered from to Unsafe
- 366 Change Parameters of PluginDragEntered from (pluginDragEvent: Instance) to (dragData: Dictionary)
- 366 Change Security of PluginDragEntered from RobloxScriptSecurity to PluginSecurity
- 354 Add PluginDragEntered
PluginDragLeft
Parameters (1) | |
---|---|
dragData | Dictionary |
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:
Security | PluginSecurity |
---|---|
Thread safety | Unsafe |
History 4
- 462 Change ThreadSafety of PluginDragLeft from to Unsafe
- 366 Change Parameters of PluginDragLeft from (pluginDragEvent: Instance) to (dragData: Dictionary)
- 366 Change Security of PluginDragLeft from RobloxScriptSecurity to PluginSecurity
- 354 Add PluginDragLeft
PluginDragMoved
Parameters (1) | |
---|---|
dragData | Dictionary |
PluginDragMoved fires when the user's mouse moves within a PluginGui during a drag operation started by Plugin:StartDrag().
See also:
Security | PluginSecurity |
---|---|
Thread safety | Unsafe |
History 4
- 462 Change ThreadSafety of PluginDragMoved from to Unsafe
- 366 Change Parameters of PluginDragMoved from (pluginDragEvent: Instance) to (dragData: Dictionary)
- 366 Change Security of PluginDragMoved from RobloxScriptSecurity to PluginSecurity
- 354 Add PluginDragMoved
Title
Type | Default | |
---|---|---|
string |
The title that is displayed above the contents of the PluginGui. Defaults to empty string.
Thread safety | ReadSafe |
---|---|
Category | Data |
Loaded/Saved | true |
WindowFocusReleased
Parameters (0) | ||
---|---|---|
No parameters. |
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.
Security | PluginSecurity |
---|---|
Thread safety | Unsafe |
History 4
- 462 Change ThreadSafety of WindowFocusReleased from to Unsafe
- 354 Add WindowFocusReleased
- 349 Remove WindowFocusReleased
- 338 Add WindowFocusReleased
WindowFocused
Parameters (0) | ||
---|---|---|
No parameters. |
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.
Security | PluginSecurity |
---|---|
Thread safety | Unsafe |
History 4
- 462 Change ThreadSafety of WindowFocused from to Unsafe
- 354 Add WindowFocused
- 349 Remove WindowFocused
- 338 Add WindowFocused
Removed members 1
HostWidgetWasRestored
Type | Default | |
---|---|---|
bool |
Category | |
---|---|
Loaded/Saved | false |
History 2
- 349 Remove HostWidgetWasRestored
- 326 Add HostWidgetWasRestored