- Home /
how can i get GUI.Button presse(or down not click)
like EZGUI UIButton.CONTROL_STATE.PRESS
Answer by GuyTidhar · Jul 04, 2011 at 06:29 AM
Are you talking about "GUI.RepeatButton"? It does the same as button but when you keep the mouse pressed on it
Answer by evax · Jul 04, 2011 at 07:17 AM
no i want to know mouse down in GUI.Button() (like input.buttondown()) because i want play some effect that timing
sure i can use
void update()
{
if ( buttonRect.contain( input.mousePosition ) )
DoSomething();
}
but i thing this code is not intuitive
Answer by Dreamora · Jul 04, 2011 at 07:20 AM
But thats exactly what you will need to use, rect check + mouse down. Also I think its pretty intuitive, on iOS you work all the time with it as thats how touch works too :)
The GUI.xxx commands only give you a code response (the visual change is automatic) if the action of the element takes place and for buttons thats click
Your answer
![](https://koobas.hobune.stream/wayback/20220612132325im_/https://answers.unity.com/themes/thub/images/avi.jpg)
Follow this Question
Related Questions
GUI in the middle of the screen 1 Answer
GUI draw rectangle script not drawing rectangle! 1 Answer
GUI animated menus 2 Answers
Load an image from www and save it for offline use 0 Answers
GetComponent Help 2 Answers