I want to know if some stuff are possible when making a plugin, since im new to making plugins, i want to know if it’s possible to get a mouse position (UDim2) from inside the plugin widget, here is my idea to understand it further:
‘Icon Maker’
The plugin widget
My idea is to make a drawing area, where devs can draw what their icons should look like, and then simply click a ‘print’ to send the final result to ReplicatedStorage, but i forgot to test if it’s even possible to get the mouse position from inside the plugin widget.
I tried using plugin:GetMouse() but it only works on the 3D space, i used the script on the Plugin:GetMouse() documentation below
PluginMouse Documentation
plugin:Activate(false) -- gain non exclusive access to the mouse
local mouse = plugin:GetMouse()
local function button1Down()
print("Left mouse click")
end
mouse.Button1Down:Connect(button1Down)
I want to know if there is any way to get the position, since im a begginer at making plugins, i dont know what i could try
Edit: Here is some of the code for reference
--local TagS = game:GetService("CollectionService")
local Selection = game:GetService("Selection")
local toolbar = plugin:CreateToolbar("Image")
local newScriptButton = toolbar:CreateButton("Icon Maker",
"Make your own icon",
"rbxasset://studio_svg_textures/Shared/InsertableObjects/Dark/Standard/Decal@3x.png")
newScriptButton.ClickableWhenViewportHidden = true
local WindowContents = script.Parent.WidgetContent
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
800, -- Default width of the floating window
800, -- Default height of the floating window
600, -- Minimum width of the floating window (optional)
600 -- Minimum height of the floating window (optional)
)
local testWidget = plugin:CreateDockWidgetPluginGui("IconMaker", widgetInfo)
local OpenW = testWidget.Enabled or false
--print(OpenW)
testWidget.Title = "Icon Maker"
WindowContents.Parent = testWidget
newScriptButton.Click:Connect(function()
OpenW = not OpenW
if OpenW then
testWidget.Enabled = true
else
testWidget.Enabled = false
end
end)