MisterQuestions Posted December 31, 2014 Posted December 31, 2014 Hey, it is possible, to make when the cursor gets over a interface of rectangle, text or something, change it color, size or thing like that?? How, and what measures i should use? "El conocimiento jamás debe detenerse, por que es lo único que nos salvará cuando no nos quede más". Att: -|TG|-Mister[Q]<.
MTA Team botder Posted December 31, 2014 MTA Team Posted December 31, 2014 Do you mean DirectX windows or GUI? GitHub: Debug Console • MTA-Discord Relay Scripting: How to draw a line chart with DirectX functions? • Doppler Effect in MTA • Get the client's FPS • Customizable Blur Shader
MisterQuestions Posted December 31, 2014 Author Posted December 31, 2014 dx Interface, like rectangles, texts, images... "El conocimiento jamás debe detenerse, por que es lo único que nos salvará cuando no nos quede más". Att: -|TG|-Mister[Q]<.
Castillo Posted December 31, 2014 Posted December 31, 2014 You can use this simple function: function isMouseInPosition ( x, y, width, height ) if ( not isCursorShowing ( ) ) then return false end local sx, sy = guiGetScreenSize ( ) -- Get the player screen resolution local cx, cy = getCursorPosition ( ) -- Get the cursor position local cx, cy = ( cx * sx ), ( cy * sy ) -- Convert relative positions to absolute if ( cx >= x and cx <= x + width ) and ( cy >= y and cy <= y + height ) then return true else return false end end Example: addEventHandler ( "onClientRender", root, function ( ) local color = tocolor ( 0, 0, 0 ) if isMouseInPosition ( 200, 200, 50, 50 ) then color = tocolor ( 255, 0, 0 ) end dxDrawRectangle ( 200, 200, 50, 50, color ) end ) San Andreas Utopia RPG (SAUR) Owner & Developer. Education is the most powerful weapon which you can use to change the world.
MisterQuestions Posted December 31, 2014 Author Posted December 31, 2014 Oh crist, thanks!! "El conocimiento jamás debe detenerse, por que es lo único que nos salvará cuando no nos quede más". Att: -|TG|-Mister[Q]<.
Castillo Posted January 1, 2015 Posted January 1, 2015 You're welcome. San Andreas Utopia RPG (SAUR) Owner & Developer. Education is the most powerful weapon which you can use to change the world.
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