How to change the cursor completely

i really want to know how to change the cursor icon id when is normal, when is on a button, or when click detection, like is on the title, COMPLETELY.

(will be thanked if you show me what part of the docs are, or just making a example)

3 Likes

I donā€™t know what you mean by COMPLETELY, but you can change the mouses icon by first getting the mouse like so ā€œlocal mouse = game.Players.LocalPlayer:GetMouse()ā€ and then doing ā€œmouse.Icon = ā€œicon.id.hereā€ā€.

Example:

local plr = game.Players.LocalPlayer
local mouse = plr:GetMouse()

mouse.Icon = "image id here"

I wrote this all on a phone so it might not be perfect.

2 Likes

By ā€˜completelyā€™ he meant so even a ClickDetector canā€™t change the cursor.
A ClickDetector fortunately as a Property called CursorIcon, which does the same thing as :GetMouse().Icon.

local ID = "..."
game:GetService('Players').LocalPlayer:GetMouse().Icon = ID
ClickDetector.CursorIcon = ID -- Get ClickDetector via any method

The code above is recommended to be a localscript.

3 Likes

you can make not change like this ā€¦ clickDetector.CursorIcon = ā€œā€

1 Like

what i mean by completely is, change all the default icons to custom one, and not by doing it all manually with the click detections functions, by literaly change the default icons.
like the icons when is just there, when is hovered on something indicating that you can click on it (example: gui button), that what i mean completely

(@Soulx_xFlame, @2112Jay, @Emp_or)

2 Likes

Your answer is a combination of all the replies.

1 Like

Wouldnā€™t it just default to the pixelated mouse click icon instead?

Is this what youā€™re looking to understand? ā€¦

local button = script.Parent

local NORMAL_CURSOR_ID = Enum.CursorType.Default
local HOVER_CURSOR_ID = Enum.CursorType.PointingHand
local CLICK_CURSOR_ID = Enum.CursorType.Cross

button.MouseEnter:Connect(function()
    button.MouseIcon = HOVER_CURSOR_ID
end)

button.MouseLeave:Connect(function()
    button.MouseIcon = NORMAL_CURSOR_ID
end)

button.MouseButton1Down:Connect(function()
    button.MouseIcon = CLICK_CURSOR_ID
end)

button.MouseButton1Up:Connect(function()
    button.MouseIcon = NORMAL_CURSOR_ID
end)

Guess you would Just change it or change it back to what you like in each case.

1 Like

Hmm, that isnā€™t working the way it used to. Maybe I was just thinking about something else.

i dont know what you guys are thinking of, cuz i cant put it in simple words, im trying to make a customize cursor, without using any of the common methods.

AVGC showed you how to change it to anything.
My post showed you how to keep it that way ā€¦

You guys are idiots.
Heā€™s asking how to change the hovering cursor to make the appearance completely consistent.

@amarodjdja Unfortunately, I donā€™t have an answer as Iā€™ve had a similar issue before. However, I hope someone helps. Iā€™d assume itā€™s a Roblox thing, and you unfortunately cannot modify default hovering cursors. Therefore, other games might not use TextButtons but frames only, like RetroStudio.

1 Like

Do you even try your own solutions? Itā€™s clear that using that script on a TextButton, ImageButton, or any kind of GUI button in Studio will not work.

1 Like

Not most of the time ā€¦ By the time you get back from the studio itā€™s solved .

that is exacly what i was trying to say, but well i see, is very complicated to make a custom cursor

1 Like

?? what are you talking about itā€™s solved, itā€™s not solved lol

1 Like

the roblox engine sucks and they forgot to create specific propreties for all different kind of cursors, so when you hover a gui or something it will not work

1 Like

Yup. That comment is a truth nuke right there.

1 Like

soooo. at this should i do it all manually???, i think is the worst option that i could think of
@BushMessiah

Well, you could hide the cursor and create a completely new one that follows your mouse every frame. This way you could code it to change its image to whatever you want whenever youā€™re hovering over something. I believe you could use MouseEnter to check when youā€™re in or outside the bounds of the gui element if I am not mistaken.

2 Likes