How to permanently change the default mouse icon

The current method for permanently changing the on-screen mouse icon (so even a textbutton won’t change it. Yes changing active can keep it the same when hovered but not when clicked) is making an imagelabel track it which seems inefficient. This isn’t a studio request because I am wondering if there is a way to make the mouse stay the same when you click on something all the time instead of having to make the mouseicon change every time you click.

Apologies if this has been addressed already which wouldn’t surprise me but I can’t find any at the moment that ask this kind of question.

3 Likes

If you are referring to the mouse icon of click detectors, you could change the curson icon property of the click detector

https://developer.roblox.com/api-reference/property/ClickDetector/CursorIcon

1 Like

Should have been more specific, sorry! I am referring to the default roblox mouse icon that’s on screen and not one created through click detectors.

Hmm, maybe this post would be helpful

Already did this however when you click a clickable GUI element the mouseicon still changes, that’s my issue. I know changing active makes hover not an issue.

I was looking through the forums and saw this post (similar to what you’ve stated)

Even a Roblox Staff member would go for this method, but I kinda agree that it’s inefficient.

2 Likes

Since 2014 and yet still no feature for changing the mouseicon permanently even when clicking a GUI element.:pensive:

2 Likes

For security reasons, this is not allowed.

You can change the Icon property of PlayerMouse, though that will still be overridden by the Gui engine upon hovering over a GuiButton. You can also create a custom mouse using a SurfaceGui and other Gui objects, though developer-created Guis do not render over CoreGuis for security reasons.

In short, you cannot “permanently” change the mouse icon.

1 Like

In 2019 do I really have to use this code still?
local button = script.Parent
local mouse = game.Players.LocalPlayer:GetMouse()
local icon = button.Parent.ImageLabel

button.MouseEnter:connect(function(x,y)
	game:GetService("UserInputService").MouseIconEnabled = false
	icon.Visible = true
end)

button.MouseLeave:connect(function()
	game:GetService("UserInputService").MouseIconEnabled = true
	icon.Visible = false
end)

game:GetService("RunService").RenderStepped:connect(function()
	icon.Position = UDim2.new(0, mouse.X - 25, 0, mouse.Y - 25)
end)

Is there a dev post or something like that, that can help me make it so no matter where the mouse is the image will be over it.

2 Likes

If you only need your custom mouse ScreenGui to render on top of your other developer-created Guis, you can change the DisplayOrder of your icon ScreenGui to a value higher than every other ScreenGui (such as 1000, or math.huge if that’s supported).

With that, you can also void the entire need to flip between icons (get rid of MouseIconEnabled = true) and just implement your custom mouse icon fully in Lua and Gui objects.

1 Like