hi ! , I want to create a button with GUI.Button and it began longer when the mouse survol on it , how can i do it , and thank you ![]()
1 Answer
1So you want the button to become larger when the mouse scrolls over it? Or itβs becoming larger and you donβt what it to?
Assuming you want it to become bigger, use OnMouseEnter. That will tell you when the mouse has scrolled over the button. Then within the OnMouseEnter function, change the size of the button to make it bigger.
hello ,ty for the help but the problem that we dont know how to use it(OnMouseOver) ,if you can give us a simple code that contain something like that thank you again
β Zouaghi-HouSSeMRead the documentation I linked to in my answer. There is a simple code example there. I'll do you the favor of copy/pasting it here. This example will turn an object's color red when the player mouses over it: function OnMouseEnter () { renderer.material.color = Color.red; }
β murkantilismNo. Simply attaching the example script from the documentation to any object will make it the color red when the player scrolls over it.
β murkantilism
what do you mean by survol?
β miskomaYou had me until "and it began longer when the mouse survol on it". I have no clue what this means.
β murkantilismsorry for my english ;) when the mouse over a gui.button . the button gets larger! like this [9061-boutton.jpg|9061]
β ines