Skip to content

Class · inherits LayerCollector

PluginGui

Official docs ↗

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

About PluginGui

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

  • Title: stringThe title that is displayed above the contents of the PluginGui.

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

Methods 2

  • BindToClose(function: Function = nil) → ()Binds a function that runs when the user closes the PluginGui.

    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:

    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:

    pluginGui:BindToClose()
    

    See also:

  • GetRelativeMousePosition() → Vector2PluginReturns the position of the mouse relative to the PluginGui.

    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.

Events 6

PluginGui also has every member of LayerCollector. 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.