PluginMouse.Icon should allow user created content

As a plugin developer, it’s currently too hard to find the right cursor for plugin actions, because PluginMouse.Icon can’t be set to anything but system stored icons (AKA content starting with rbxasset:).

Example

You can see this in action yourself by running the following code as a plugin. The example uses the following images as cursors.

  • rbxasset://textures/ui/RobloxNameIcon.png (System image)
  • rbxassetid://5715427603 (User uploaded image)
Plugin Code
local toolbar = plugin:CreateToolbar("Mouse Icon Test") :: PluginToolbar
local customButton = toolbar:CreateButton("Custom", "", "rbxassetid://5715427603")
local robloxButton = toolbar:CreateButton("System", "", "rbxasset://textures/ui/RobloxNameIcon.png")
local mouse: PluginMouse = plugin:GetMouse()

local testButtons = {robloxButton, customButton}

local function onButtonClicked(button: PluginToolbarButton, value: boolean)
	-- Toggling toolbar button states
	for _, x in testButtons do
		local active = (x == button and value) or false
		x:SetAttribute("IsActive", active)
		x:SetActive(active)
	end
	
	-- Setting the mouse cursor to our clicked toolbar button icon.
	mouse.Icon = value and button.Icon or ""
	plugin:Activate(value)
end

for _, button in testButtons do
	button.Click:Connect(function()
		onButtonClicked(button, not button:GetAttribute("IsActive"))
	end)
end

Use-case

If I want to indicate an action within a widget such as magnifying an image, you’re forced to settle on whatever’s closest to that icon in your file system, which generally doesn’t look good for a cursor.

In this example, you’ll find the closest image to a magnification cursor in the file system. The reason this isn’t satisfactory is because the icon doesn’t provide contrast on white backgrounds, and because it was never meant to be a cursor, the image is too large, and offset significantly from your actual pointer.
rbxasset://textures/GameSettings/zoom.PNG
Screenshot 2024-07-04 at 6.46.20 PM

In contrast, the example below is black with a white fill for better visibility, and the icon is centered around the plus symbol, not the top of the handle.
Screenshot 2024-07-04 at 6.52.42 PM

If Roblox is able to address this issue, it would improve both my development experience, and the experience of the consumers who bought my plugins as I’d more easily be able to convey actions to users by using more familiar icons.

17 Likes