Did anyone now howto set a custom Cursors background transparent, so that I only have the Cursor?
I used this Script for custom cursor which I found in the forums:
// @var CursorNormal -> the texture of the cursor
// @var CursorPressed -> the texture of the cursor when it is pressed
// @var CursorScale
// @var GroundStyle -> Don't change anything there inside Inspector
// @private showCursor -> defines visibility of the Cursor
var CursorNormal : GUIStyle;
var CursorPressed : GUIStyle;
var CursorScale = 25;
var GroundStyle : GUIStyle;
private var showCursor = false;
function ShowCursor (show : boolean)
{
showCursor = show;
}
function Update()
{
// hides cursor if the HUD is open and vice-versa
if(Input.GetButtonDown("open/close HUD"))
{
showCursor = !showCursor;
}
}
// show our Custom Cursor
function OnGUI ()
{
if(showCursor)
{
GUI.Window(500, Rect(Event.current.mousePosition.x + 1, Event.current.mousePosition.y + 1, CursorScale, CursorScale), WindowLoop, "", GroundStyle);
GUI.BringWindowToFront(500);
}
}
// check for Cursor is clicked or not
function WindowLoop(ID : int)
{
if(Input.GetMouseButton(0))
{
GUI.Label(Rect (0, 0, CursorScale, CursorScale), "", CursorPressed);
}
else
{
GUI.Label(Rect (0, 0, CursorScale, CursorScale), "", CursorNormal);
}
}
have anyone an idea howto do this?