- Home /
Cursor issues: strange white square under cursor
I am using a custom cursor for my game, and one of my playtesters playing on Windows 10 reported that a white pixelated square appears under his cursors as shown in the attached image.
The hotspot (set at (12.5, -3)) is under the square instead of the actual cursor. This has not happened to any other users, including other Windows 10 users. I have no idea what could be causing this. He does not have any custom cursors installed on his computer. I found [this answer][2] but it wasn't very helpful. I have attached an image of my cursor settings as well. The cursor image is 25x25. I tried forcing it to 36x36 using the NonPowerOf2 setting but the bug still persists. Can anyone help me understand why this is happening? I am running Unity 5.5.0f3 Personal.
[2]: http://answers.unity3d.com/questions/920862/strange-behavior-on-cursor.html
Is there a better place to ask this question? I have no idea why this is happening or what I can do to fix it.
Ive never seen this but I would try redrawing your cursor image with more transparent space around it so that the hotspot position is not "out of bounds" in relation to the cursor image.
The hotspot position is set to be at the tip of the caret symbol. It's only in this playtester's case that it lies under the white box.
Answer by toddisarockstar · Apr 05, 2017 at 05:16 PM
Ive never seen this but I would try redrawing your cursor image with more transparent space around it so that the hotspot position is not "out of bounds" in relation to the cursor image.
in many games its common practice to hide the windows cursor and use use your own cursor anyways! This way you get cool control over scaling, color and current image anyways:)
Also the ability to force the cursor to places or move it with a joystick. here is a super simple example:
public Texture2D cursorimage;
// use this next variable anywhere in your code that would use mouse position
Vector2 mymouse;
void Start () {
Screen.showCursor = false;
}
void OnGUI(){
mymouse = new Vector2 (Input.mousePosition.x,Input.mousePosition.y);
GUI.DrawTexture (new Rect (mymouse.x,Screen.height-mymouse.y, 16, 16), cursorimage);
}
I guess I'll give this a try and see if it fixes anything. I had just wanted a simple cursor so I thought it'd be easiest to change it via Unity's settings.
I implemented this and it fixes the issue with the white square but moving the cursor doesn't feel as responsive as with the hardware cursor. Is there any way to improve it?
Your answer
Follow this Question
Related Questions
How Can I Lock The Cursor Position? 1 Answer
Artifacts on cursor when using CursorMode.Auto 0 Answers
change mouse cursor on mouseover 3 Answers
Custom Cursor? How does it work? 3 Answers
HIdden cursor slider issue 1 Answer