Quantcast
Channel: Questions in topic: "icon"
Viewing all articles
Browse latest Browse all 271

Change Mouse Icon on UI Hover

$
0
0
I want to change my mouse icon to another icon when I hover over an UI Element. The text-color is already changing, but Im not able to get the mouse icon to change. The Base Mouse Icon is the pencile, when hovering over the menu, it should change to the hand with the index finger. My MouseChange code is as follows: public Texture2D defaultTextureMouse; public Texture2D exitTextureMouse; public CursorMode curModeMouse = CursorMode.Auto; public Vector2 hotSpotMouse = Vector2.zero; // Use this for initialization void StartMouse () { Cursor.SetCursor(defaultTextureMouse, hotSpotMouse, curModeMouse); } public void OnMouseEnter() { if (gameObject.tag == "exit") { Cursor.SetCursor(exitTextureMouse, hotSpotMouse, curModeMouse); } } public void OnMouseExit() { Cursor.SetCursor(defaultTextureMouse, hotSpotMouse, curModeMouse); } I know that I have to make something with the EventTrigger. However, I dont know how to connect the script to the detection of hovering the mouse over any of the UI Text Elements. It isnt working with any Box Collider, because its a UI, right? I also dont know where to place the script to. Picture shows that I have HyperTextEvents for the color to change from black to blue and back when hovering with the mouse. ![alt text](https://i.gyazo.com/fa89ec199c9505dd6f15b745a4264e6a.png "title") I hope you guys can help me and if you need any more informations, let me know. I hope i can answer them, because I just got that project without any documentation and im also new to Unity :/

Viewing all articles
Browse latest Browse all 271

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>