Mann56 Posted February 15, 2016 Posted February 15, 2016 Hey guys, I was making a dxButton for my resource, but i have no idea how to get it clicked. I mean : I have a dxRectangle, then i can change the colour of the rectangle a bit when a players hovers his mouse over it, but how can i get his click on the dxButton, i want the button to function as a normal gui button works... Thanks for reading, Regards, Mann "When i'll grow older, i'll be stronger, they'll call me freedom, just like a waving flag" "Have confidence in yourself, no problem is impossible in life"
tosfera Posted February 15, 2016 Posted February 15, 2016 either hide a MTA GUI button under there with an alpha of 0, or just add an eventhandler; onClientClick, and add a "hoverButton = " in your render. If the hoverButton equals something, it clicks a button. If you want to contact me directly concerning Advanced-Gaming, please contact me at [email protected]
Mann56 Posted February 15, 2016 Author Posted February 15, 2016 either hide a MTA GUI button under there with an alpha of 0, or just add an eventhandler; onClientClick, and add a "hoverButton = " in your render. If the hoverButton equals something, it clicks a button. Thanks, So if i am right, i can use a onClientClick and check if the cursor was clicked in the designated area and so output the function? EDIT: Can you explain the second method of ahover button to me? I made a onClientClick and got the position of cursor using getCursorPosition, but how'd i check if the cursor is in a particular space without using gui buttons ? "When i'll grow older, i'll be stronger, they'll call me freedom, just like a waving flag" "Have confidence in yourself, no problem is impossible in life"
Dealman Posted February 15, 2016 Posted February 15, 2016 onClientClick already returns what you need, no need to use getCursorPosition. Also do yourself a favor and use isMouseInPosition. If I help you in a thread and you need further assistance, please don't PM me - use the thread you created instead. This way everyone on the forum can take advantage of it.
Mann56 Posted February 15, 2016 Author Posted February 15, 2016 onClientClick already returns what you need, no need to use getCursorPosition. Also do yourself a favor and use isMouseInPosition. Ah, Thanks a lot , it works!!!! didn't knew about isMouseInPosition.... Thanks for it Regards, Mann "When i'll grow older, i'll be stronger, they'll call me freedom, just like a waving flag" "Have confidence in yourself, no problem is impossible in life"
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now