I am developing a plugin right now and I am using it as a widget. It is way to small if you scale it down but I want it to be able to scale down a lot. Is there any way to detect when the widget is a certain size and execute something. Any help is amazing. Code down below:
--Creates The Plugin--
local toolbar = plugin:CreateToolbar("HyperStudio's")
local CreatePlugin = toolbar:CreateButton("UI QuickClick", "UI QuickClick", "rbxassetid://13842694602 ")
local CHS = game:GetService("ChangeHistoryService")
local Selection = game:GetService("Selection")
--Sets Plugin--
local widgetInfo = DockWidgetPluginGuiInfo.new(
Enum.InitialDockState.Float, -- Widget will be initialized in floating panel
false, -- Widget will be initially enabled
false, -- Don't override the previous enabled state
200, -- Default width of the floating window
200, -- Default height of the floating window
200, -- Minimum width of the floating window
200 -- Minimum height of the floating window
)
-- Create new widget GUI
local Main = plugin:CreateDockWidgetPluginGui("TestWidget", widgetInfo)
Main.Title = "UI QuickClick"
Main.Enabled = not Main.Enabled
local MainUI = script.Parent.PluginUI.PluginCoreUI
local MainUISidebar = script.Parent.PluginUI.PluginCoreUI.SideBar
MainUI.Parent = Main
local isOn = false
wait(0.1)
CreatePlugin.Click:Connect(function()
isOn = not isOn
CreatePlugin:SetActive(isOn)
Main.Enabled = isOn
end)