Hello I’m trying to figure out how to change the appearance of the hardware mouse cursor in-game. I checked out the MouseCursor class but it is EXTREMELY vague. I thought perhaps changing MouseCursor.Arrow is how I am supposed to do it, but the reference doesn’t tell me what kind of value it accepts.
Can anyone shed some light on how to do this? Thanks.
Ok. So I wanted to change the hardware cursor but instead I had to make a software cursor, whose performance depends on the frame rate of the game.
Here is some code for it:
var custom_cursor:Texture;
function Start(){
Screen.showCursor=false;
}
function OnGUI(){
var mouse_pos=Input.mousePosition;
var pos=Rect(mouse_pos.x,Screen.height-mouse_pos.y,custom_cursor.width,custom_cursor.height);
GUI.Label(pos,custom_cursor);
}
It just makes the real cursor invisible and overlays the custom cursor image on top of its position.