Im trying to make custom cursor, but image offset kinda broken
Using AnchorPoint (0.5,0.5)
mouseImage.Position = UDim2.new(0,mouse.X - (mouseImage.AbsoluteSize.X/2),0,mouse.Y - (mouseImage.AbsoluteSize.Y/2))
any way to fix it?
Im trying to make custom cursor, but image offset kinda broken
Using AnchorPoint (0.5,0.5)
mouseImage.Position = UDim2.new(0,mouse.X - (mouseImage.AbsoluteSize.X/2),0,mouse.Y - (mouseImage.AbsoluteSize.Y/2))
any way to fix it?
You don’t have to do that, you can just use this Mouse | Roblox Creator Documentation to set the Cursor Icon
i need cursor to be “flexible”, so i can change color, size and etc
You could just create a simple script that overrides the Roblox cursor:
game.Players.LocalPlayer:GetMouse().Icon = "rbxassetid://4264273816"
This is a very simple script you put into StarterGUI.
Edit: As an attempt to meet up with your desires, this is not exactly flexible. The only thing you can really do is design an icon of your choice and put it there.
Like Znimator said, They need it to be flexible so they can change the color and size.
You could just upload multiple colored images and sort them in a table and use it when you need it?
Thats worst idea, i just need set right offset.
What about mouseImage.Position = UDim2.new(0, mouse.X, 0, mouse.Y)
?
"I’m not sure if it’s possible to do the same thing without having to do some testing to find the best offset"
That would work, however, he needs to play around with mouse.X and mouse.Y.
For example after some testing, my custom mouse ended up needing to add 1.5 to mouse.X and remove 9 from mouse.Y.
Example of what I’m talking about:
mouseImage.Position = UDim2.new(0,mouse.X + 1.5,0,mouse.Y - 9)
He stated that he wasn’t using an AnchorPoint of 0, 0
Using AnchorPoint (0.5,0.5)
I fixed my problem by disabling IgnoreGuilnset