3B00DG4MER Posted January 12, 2015 Share Posted January 12, 2015 (edited) Hi Guys, Today i making a new script dx GUI for my server BLAH Blah blah ..... what i want is How to trigger Event onClientRender and check if Left Mouse is Down without onClientClick Event cuz it will gives lagg on Event "OnClientRender" local sW, sH = guiGetScreenSize() function dxDrawButton(x, y, w, h, text, color, borderColor,font) local font = font or "pricedown" dxDrawRectangle(x ,y ,w ,h, color) dxDrawRectangle(x, y, w, 1, borderColor) dxDrawRectangle(x, y, 1, h, borderColor) dxDrawRectangle(x, y + h, w, 1, borderColor) dxDrawRectangle(x + w, y , 1, h, borderColor) if text then dxDrawText ( text, x, y, x + w, y + h, tocolor(31,31,31), 1, font, "center", "center") end if isMouseWithinRangeOf(x, y, w, h) then dxDrawRectangle(x ,y,w,h,tocolor(0,255,255)) -- I think here i put the event but i've to check first if Mouse Stat (if left Mouse is down) if text then dxDrawText ( text, x, y , x + w, y + h, tocolor(255,255,255), 1, font, "center", "center") end end end function isMouseWithinRangeOf(posX, posY, sizeX, sizeY) if isCursorShowing() == false then return false end local cx,cy = getCursorPosition() cx,cy = cx*sW,cy*sH if cx >= posX and cx <= posX+sizeX and cy >= posY and cy <= posY+sizeY then return true,cx,cy else return false end end Edited January 12, 2015 by Guest Link to comment
Dealman Posted January 12, 2015 Share Posted January 12, 2015 Can't you use getKeyState instead of onClientClick? Link to comment
3B00DG4MER Posted January 12, 2015 Author Share Posted January 12, 2015 Can't you use getKeyState instead of onClientClick? Next time, i've to Save wiki on my Brian Thanks 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