A simple, type safe and minimalistic wrapper of Roblox Studio DockWidgetPluginGui Its fully O(1) complexity.
for all the methods head to Methods
local Widget = require(script.Parent.widget)
local widget = Widget.new(plugin, {
id = "Widget",
title = "Widget",
state = Enum.InitialDockState.Float,
size = Vector2.new(250, 250),
min_size = Vector2.new(100, 100),
enabled = true,
restore = true,
})
local frame = Instance.new("Frame")
local text_label = Instance.new("TextLabel")
widget:mount(frame, text_label) -- add instances to the widget
widget:unmount(frame, text_label) -- remove instances from the widget
widget:clear() -- destroy all instances parented to the widget
new(plugin, props)
-> class constructordestroy()
-> destroy the widgetshow()
-> show the widgethide()
-> hide the widgetvisible()
-> returns if the widget is visibleset_title(title)
-> updates the current widget titleget()
-> returns theDockWidgetPluginGui
itselfclear()
-> removes everyInstance
parented to theDockWidgetPluginGui
mount(...)
-> parents everyInstance
given to theDockWidgetPluginGui
unmount(...)
-> destroy everyInstance
given thats parented to theDockWidgetPluginGui
this are the props you can pass to the constructor
id: string?
-> unique plugin idtitle: string?
-> widget titlestate: Enum.InitialDockState?
-> default dock statesize: Vector2?
-> default widget size in pixelsmin_size: Vector2?
-> minimal size for the widget in pixels
Warning
Minimum widget size does not work since roblox decided to update docking system.
enabled: boolean?
-> default visibilityrestore: boolean?
-> if true, will override any saved enabled state with thestate
value.