programns
(program)
October 28, 2021, 1:23pm
#1
Hey there! I’m trying to make a simple plugin for designing UI. This is my first time making a plugin, and I’ve run into a hurdle that I just can’t figure out.
I made this UI for my plugin.
However, when I open my plugin, it looks like this:
The TextButtons and TextLabels, just disappear.
This is my code:
local ToolBar = plugin:CreateToolbar("UI Design")
local UIButton = ToolBar:CreateButton("UI Design", "Spice up your UI", "rbxassetid://4458901886")
local UIWidgetInfo = DockWidgetPluginGuiInfo.new(
Enum.InitialDockState.Left,
false,
false,
200,
300,
150,
150
)
local UIWidget = plugin:CreateDockWidgetPluginGui("UI Design", UIWidgetInfo)
UIWidget.Title = "UI Design"
script.Parent.Panel:Clone().Parent = UIWidget
UIButton.Click:Connect(function()
UIWidget.Enabled = not UIWidget.Enabled
UIWidget.Panel.Background.Frame1.TextButton.MouseButton1Click:Connect(function()
print("Hello")
end)
end)
As you can see, I added a print statement to detect when the button is clicked, and it does print “Hello”.
Any help is appreciated! Thanks!
1 Like
Are you using scale for position and size?
programns
(program)
October 28, 2021, 1:30pm
#3
Yep, I’m using scale for position and size.
Try using offset instead of scale.
programns
(program)
October 28, 2021, 1:32pm
#5
Let me try using offset. Thanks for responding!
programns
(program)
October 28, 2021, 1:37pm
#6
Should I be using offset for both position and scale?
Stop what ur doing, I totally saw this over my head, but why are you cloning the frame instead of using the frame?
regexman
(reg)
October 28, 2021, 1:41pm
#8
Make the position offset, but make size to scale .
Worked for me with widgets
programns
(program)
October 28, 2021, 1:41pm
#9
Yeah, I’m cloning it into the widget.
Is panel the ScreenGUI or the frame?
regexman
(reg)
October 28, 2021, 1:45pm
#12
Don’t ignore me, make position offset and size scale
programns
(program)
October 28, 2021, 1:45pm
#13
Let me try that out. Thanks for responding!
regexman
(reg)
October 28, 2021, 1:46pm
#15
If you make it screengui it will error (in my experience atleast)
regexman
(reg)
October 28, 2021, 1:48pm
#17
maybe you didn’t read carefully, read again
programns
(program)
October 28, 2021, 1:48pm
#18
That won’t work. I did that at the beginning, but unfortunately it didn’t work.
programns
(program)
October 28, 2021, 1:49pm
#20
Yep I made the position offset, but the size scale, and it didn’t work.
Did you try not cloning it and using panel as-is?
programns
(program)
October 28, 2021, 1:50pm
#22
Haha, totally didn’t steal the UI I made for you Thanks for responding anyway lol.
1 Like