gokalpfirat Posted July 23, 2012 Share Posted July 23, 2012 How can i make a rectangle that made with dxCreateRectangle and when I get my cursor on rectangle It changes its color. Link to comment
Guest Guest4401 Posted July 23, 2012 Share Posted July 23, 2012 You can get cursor position and check if it is within the rectangle using getCursorPosition or make an invisible(alpha: 0) GUI element over it and use the events onClientMouseEnter, onClientMouseLeave. Link to comment
MIKI785 Posted July 23, 2012 Share Posted July 23, 2012 I'm not experienced with dx Drawing functions... Try https://wiki.multitheftauto.com/wiki/OnClientMouseEnter but I think that it does not support dx Drawings... You can use https://wiki.multitheftauto.com/wiki/OnClientCursorMove, but that will be more difficult. Link to comment
gokalpfirat Posted July 23, 2012 Author Share Posted July 23, 2012 I think Karthik's method is nice but I need some other methods Link to comment
AeroXbird Posted July 23, 2012 Share Posted July 23, 2012 What karthik said is a fairly common method to use. for example, you have a small dx rectangle, and it starts at x 6 and ends at x 13 then you simply do this: if ( x >= 6 and x <= 13 ) then and simply add the same for the y value, it will make a reasonably large if, but it will do the job perfectly without having to use any eventhandlers. ( other than onClientRender ofcourse ) Link to comment
gokalpfirat Posted July 24, 2012 Author Share Posted July 24, 2012 Can you give an working example? Link to comment
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