RedOne Posted November 6, 2017 Share Posted November 6, 2017 السلام عليكم شباب انا بجرب اعمل زر بيتغير لونه فى لوحه دى اكس عوز لما اشاور على الكلمه اللونه يتغير دلوقتى انا لما بشاور على الكلمه اللون بيتغير تمام .. بس دلوقتى لما بشاور فى ايه حته ف اللوحه لون الكلمه بيتغير انا عاوز لما اشاور على الكلمه بس لونو يتغير مش لما اشاور ف كل حته وشكرا function cursorPosition(x, y, w, h) if (not isCursorShowing()) then return false end local mx, my = getCursorPosition() local fullx, fully = guiGetScreenSize() cursorx, cursory = mx*fullx, my*fully if cursorx > x and cursorx < x + w and cursory > y and cursory < y + h then return true else return false end end ------ function pro() dxDrawRectangle(382, 327, 492, 230, tocolor(0, 0, 0, 126), true) if(cursorPosition(587, 428, 681, 454))then----عند لمس الزر dxDrawText("Kill", 587, 428, 681, 454, tocolor(255, 0, 0, 255), 1.00, "bankgothic", "left", "top", true, true, true, true, true) else dxDrawText("Kill", 587, 428, 681, 454, tocolor(255, 255, 255, 255), 1.00, "bankgothic", "left", "top", true, true, true, true, true) end end Link to comment
Doffy Posted November 6, 2017 Share Posted November 6, 2017 function isMouseInPosition ( x, y, width, height ) if ( not isCursorShowing( ) ) then return false end local sx, sy = guiGetScreenSize ( ) local cx, cy = getCursorPosition ( ) local cx, cy = ( cx * sx ), ( cy * sy ) if ( cx >= x and cx <= x + width ) and ( cy >= y and cy <= y + height ) then return true else return false end end function pro() dxDrawRectangle(382, 327, 492, 230, tocolor(0, 0, 0, 126), true) if( isMouseInPosition(587, 428, 681, 454) )then----عند لمس الزر dxDrawText("Kill", 587, 428, 681, 454, tocolor(255, 0, 0, 255), 1.00, "bankgothic", "left", "top", true, true, true, true, true) else dxDrawText("Kill", 587, 428, 681, 454, tocolor(255, 255, 255, 255), 1.00, "bankgothic", "left", "top", true, true, true, true, true) end end 1 Link to comment
RedOne Posted November 6, 2017 Author Share Posted November 6, 2017 36 minutes ago, #Himoo said: function isMouseInPosition ( x, y, width, height ) if ( not isCursorShowing( ) ) then return false end local sx, sy = guiGetScreenSize ( ) local cx, cy = getCursorPosition ( ) local cx, cy = ( cx * sx ), ( cy * sy ) if ( cx >= x and cx <= x + width ) and ( cy >= y and cy <= y + height ) then return true else return false end end function pro() dxDrawRectangle(382, 327, 492, 230, tocolor(0, 0, 0, 126), true) if( isMouseInPosition(587, 428, 681, 454) )then----عند لمس الزر dxDrawText("Kill", 587, 428, 681, 454, tocolor(255, 0, 0, 255), 1.00, "bankgothic", "left", "top", true, true, true, true, true) else dxDrawText("Kill", 587, 428, 681, 454, tocolor(255, 255, 255, 255), 1.00, "bankgothic", "left", "top", true, true, true, true, true) end end برنس برنس Link to comment
Doffy Posted November 6, 2017 Share Posted November 6, 2017 Just now, RedOne said: برنس برنس حياك الله Link to comment
Ahmed Ly Posted November 6, 2017 Share Posted November 6, 2017 function isMouseInPosition ( x, y, width, height ) if ( not isCursorShowing( ) ) then return false end local sx, sy = guiGetScreenSize ( ) local cx, cy = getCursorPosition ( ) local cx, cy = ( cx * sx ), ( cy * sy ) if ( cx >= x and cx <= x + width ) and ( cy >= y and cy <= y + height ) then return true else return false end end ------ color = {} function pro() color[1] = tocolor(255, 255, 255, 255) if isMouseInPosition(587, 428, 681, 454) then color[1] = tocolor(255, 0, 0, 255) end dxDrawRectangle(382, 327, 492, 230, tocolor(0, 0, 0, 126), true) dxDrawText("Kill", 587, 428, 681, 454,color[1], 1.00, "bankgothic", "left", "top", true, true, true, true, true) end 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