Jump to content

dxButton


Mann56

Recommended Posts

Posted

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"

Posted

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.

logo-small.png?v=3 tiny-sapdfr.png

 

If you want to contact me directly concerning Advanced-Gaming, please contact me at [email protected]

Posted
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"

Posted
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 :P

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"

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...