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)
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)
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.
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.
you can make not change like this ā¦ clickDetector.CursorIcon = āā
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
Your answer is a combination of all the replies.
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.
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.
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.
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.
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
?? what are you talking about itās solved, itās not solved lol
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
Yup. That comment is a truth nuke right there.
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.