AchrefF Posted March 11, 2017 Share Posted March 11, 2017 (edited) شباب ازاى اعمل زر فى لوحه DX بعرف اعمل زر مخفى بس عوز زر اول ما اشاور عليه ب الماوس يقلب لون تانى Edited March 11, 2017 by AchrefF Link to comment
AHMED MOSTAFA Posted March 11, 2017 Share Posted March 11, 2017 (edited) 15 minutes ago, AchrefF said: شباب ازاى اعمل زر فى لوحه DX بعرف اعمل زر مخفى بس عوز زر اول ما اشاور عليه ب الماوس يقلب لون تانى dxCreateButton "onClientMouseEnter" "onClientMouseLeave" Edited March 11, 2017 by Killer Project event 1 Link to comment
Ahmed Ly Posted March 11, 2017 Share Posted March 11, 2017 استخدام cursorPosition -- dxDrawBorderedText -- function dxDrawBorderedText ( text, x, y, w, h, color, scale, font, alignX, alignY, clip, wordBreak, postGUI, color2 ) local wh = 1 local msg_gsub = text if type(text) == 'string' then msg_gsub = text:gsub ( '#%x%x%x%x%x%x', '' ) end dxDrawText ( msg_gsub, x - wh, y - wh, w - wh, h - wh, tocolor ( 0, 0, 0, 255 ), scale, font, alignX, alignY, clip, wordBreak, false ) -- black dxDrawText ( msg_gsub, x + wh, y - wh, w + wh, h - wh, tocolor ( 0, 0, 0, 255 ), scale, font, alignX, alignY, clip, wordBreak, false ) dxDrawText ( msg_gsub, x - wh, y + wh, w - wh, h + wh, tocolor ( 0, 0, 0, 255 ), scale, font, alignX, alignY, clip, wordBreak, false ) dxDrawText ( msg_gsub, x + wh, y + wh, w + wh, h + wh, tocolor ( 0, 0, 0, 255 ), scale, font, alignX, alignY, clip, wordBreak, false ) dxDrawText ( msg_gsub, x - wh, y, w - wh, h, tocolor ( 0, 0, 0, 255 ), scale, font, alignX, alignY, clip, wordBreak, false ) dxDrawText ( msg_gsub, x + wh, y, w + wh, h, tocolor ( 0, 0, 0, 255 ), scale, font, alignX, alignY, clip, wordBreak, false ) dxDrawText ( msg_gsub, x, y - wh, w, h - wh, tocolor ( 0, 0, 0, 255 ), scale, font, alignX, alignY, clip, wordBreak, false ) dxDrawText ( msg_gsub, x, y + wh, w, h + wh, tocolor ( 0, 0, 0, 255 ), scale, font, alignX, alignY, clip, wordBreak, false ) dxDrawText ( text, x, y, w, h, color, scale, font, alignX, alignY, clip, wordBreak, postGUI, color2 ) end 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 --Event "onClientRender" -- مثال sx_, sy_ = guiGetScreenSize ( ) sx, sy = sx_ / 1280, sy_ / 720 function dxDrawBorderedText ( text, x, y, w, h, color, scale, font, alignX, alignY, clip, wordBreak, postGUI, color2 ) local wh = 1 local msg_gsub = text if type(text) == 'string' then msg_gsub = text:gsub ( '#%x%x%x%x%x%x', '' ) end dxDrawText ( msg_gsub, x - wh, y - wh, w - wh, h - wh, tocolor ( 0, 0, 0, 255 ), scale, font, alignX, alignY, clip, wordBreak, false ) -- black dxDrawText ( msg_gsub, x + wh, y - wh, w + wh, h - wh, tocolor ( 0, 0, 0, 255 ), scale, font, alignX, alignY, clip, wordBreak, false ) dxDrawText ( msg_gsub, x - wh, y + wh, w - wh, h + wh, tocolor ( 0, 0, 0, 255 ), scale, font, alignX, alignY, clip, wordBreak, false ) dxDrawText ( msg_gsub, x + wh, y + wh, w + wh, h + wh, tocolor ( 0, 0, 0, 255 ), scale, font, alignX, alignY, clip, wordBreak, false ) dxDrawText ( msg_gsub, x - wh, y, w - wh, h, tocolor ( 0, 0, 0, 255 ), scale, font, alignX, alignY, clip, wordBreak, false ) dxDrawText ( msg_gsub, x + wh, y, w + wh, h, tocolor ( 0, 0, 0, 255 ), scale, font, alignX, alignY, clip, wordBreak, false ) dxDrawText ( msg_gsub, x, y - wh, w, h - wh, tocolor ( 0, 0, 0, 255 ), scale, font, alignX, alignY, clip, wordBreak, false ) dxDrawText ( msg_gsub, x, y + wh, w, h + wh, tocolor ( 0, 0, 0, 255 ), scale, font, alignX, alignY, clip, wordBreak, false ) dxDrawText ( text, x, y, w, h, color, scale, font, alignX, alignY, clip, wordBreak, postGUI, color2 ) end font2 = dxCreateFont("Dragon.ttf",10) lol = { } function Dx () lol[1] = tocolor(0, 0, 0, 0) lol[2] = tocolor(0, 0, 0, 0) if ( cursorPosition(sx*343,sy*489,sx*94,sy*46) ) then lol[1] = tocolor(82,137,153) end if ( cursorPosition(sx*561,sy*489,sx*94,sy*46) ) then lol[2] = tocolor(82,137,153) end dxDrawLine(sx*282 - 1,sy*249 - 1,sx*282 - 1,sy*553, tocolor(0, 0, 0, 255), 1, false) dxDrawLine(sx*769,sy*249 - 1,sx*282 - 1,sy*249 - 1, tocolor(0, 0, 0, 255), 1, false) dxDrawLine(sx*282 - 1,sy*553,sx*769,sy*553, tocolor(0, 0, 0, 255), 1, false) dxDrawLine(sx*769,sy*553,sx*769,sy*249 - 1, tocolor(0, 0, 0, 255), 1, false) dxDrawRectangle(sx*282,sy*249,sx*487,sy*304, tocolor(80, 173, 163, 87), false) dxDrawLine(sx*281 - 1,sy*248 - 1,sx*281 - 1,sy*282, tocolor(0, 0, 0, 255), 1, false) dxDrawLine(sx*769,sy*248 - 1,sx*281 - 1,sy*248 - 1, tocolor(0, 0, 0, 255), 1, false) dxDrawLine(sx*281 - 1,sy*282,sx*769,sy*282, tocolor(0, 0, 0, 255), 1, false) dxDrawLine(sx*769,sy*282,sx*769,sy*248 - 1, tocolor(0, 0, 0, 255), 1, false) dxDrawRectangle(sx*281,sy*248,sx*488,sy*34, tocolor(58, 133, 196,255), false) dxDrawBorderedText("",sx*288,sy*329,sx*365,sy*376, tocolor(68, 34, 218, 254), 1.00,font2, "center", "center", false, false, false, true, false) dxDrawBorderedText("",sx*288,sy*390,sx*365,sy*437, tocolor(118, 43, 210, 255), 1.00,font2, "center", "center", false, false, false, true, false) dxDrawLine(sx*343 - 1,sy*489 - 1,sx*343 - 1,sy*535, tocolor(0, 0, 0, 255), 1, false) dxDrawLine(sx*437,sy*489 - 1,sx*343 - 1,sy*489 - 1, tocolor(0, 0, 0, 255), 1, false) dxDrawLine(sx*343 - 1,sy*535,sx*437,sy*535, tocolor(0, 0, 0, 255), 1, false) dxDrawLine(sx*437,sy*535,sx*437,sy*489 - 1, tocolor(0, 0, 0, 255), 1, false) dxDrawRectangle(sx*343,sy*489,sx*94,sy*46,lol[1], false) dxDrawLine(sx*561 - 1,sy*489 - 1,sx*561 - 1,sy*535, tocolor(0, 0, 0, 255), 1, false) dxDrawLine(sx*655,sy*489 - 1,sx*561 - 1,sy*489 - 1, tocolor(0, 0, 0, 255), 1, false) dxDrawLine(sx*561 - 1,sy*535,sx*655,sy*535, tocolor(0, 0, 0, 255), 1, false) dxDrawLine(sx*655,sy*535,sx*655,sy*489 - 1, tocolor(0, 0, 0, 255), 1, false) dxDrawRectangle(sx*561,sy*489,sx*94,sy*46,lol[2], false) dxDrawBorderedText("",sx*345,sy*492,sx*437,sy*535, tocolor(112, 217, 75, 247), 1.00,font2, "center", "center", false, false, false, true, false) dxDrawBorderedText("",sx*563,sy*492,sx*655,sy*535, tocolor(112, 217, 75, 247), 1.00,font2, "center", "center", false, false, false, true, false) dxDrawBorderedText("",sx*332,sy*252,sx*692,sy*277, tocolor(121, 216, 28, 255), 1.00,font2, "center", "center", false, false, false, true, false) dxDrawBorderedText(" ",sx*377,sy*377,sx*542,sy*390, tocolor(255, 255, 255, 255), 1.00,font2, "left", "top",false, false, false, true, true) end addEventHandler("onClientRender", root,Dx) 1 Link to comment
AchrefF Posted March 11, 2017 Author Share Posted March 11, 2017 13 minutes ago, Ahmed Ly said: استخدام cursorPosition -- dxDrawBorderedText -- function dxDrawBorderedText ( text, x, y, w, h, color, scale, font, alignX, alignY, clip, wordBreak, postGUI, color2 ) local wh = 1 local msg_gsub = text if type(text) == 'string' then msg_gsub = text:gsub ( '#%x%x%x%x%x%x', '' ) end dxDrawText ( msg_gsub, x - wh, y - wh, w - wh, h - wh, tocolor ( 0, 0, 0, 255 ), scale, font, alignX, alignY, clip, wordBreak, false ) -- black dxDrawText ( msg_gsub, x + wh, y - wh, w + wh, h - wh, tocolor ( 0, 0, 0, 255 ), scale, font, alignX, alignY, clip, wordBreak, false ) dxDrawText ( msg_gsub, x - wh, y + wh, w - wh, h + wh, tocolor ( 0, 0, 0, 255 ), scale, font, alignX, alignY, clip, wordBreak, false ) dxDrawText ( msg_gsub, x + wh, y + wh, w + wh, h + wh, tocolor ( 0, 0, 0, 255 ), scale, font, alignX, alignY, clip, wordBreak, false ) dxDrawText ( msg_gsub, x - wh, y, w - wh, h, tocolor ( 0, 0, 0, 255 ), scale, font, alignX, alignY, clip, wordBreak, false ) dxDrawText ( msg_gsub, x + wh, y, w + wh, h, tocolor ( 0, 0, 0, 255 ), scale, font, alignX, alignY, clip, wordBreak, false ) dxDrawText ( msg_gsub, x, y - wh, w, h - wh, tocolor ( 0, 0, 0, 255 ), scale, font, alignX, alignY, clip, wordBreak, false ) dxDrawText ( msg_gsub, x, y + wh, w, h + wh, tocolor ( 0, 0, 0, 255 ), scale, font, alignX, alignY, clip, wordBreak, false ) dxDrawText ( text, x, y, w, h, color, scale, font, alignX, alignY, clip, wordBreak, postGUI, color2 ) end 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 --Event "onClientRender" -- مثال sx_, sy_ = guiGetScreenSize ( ) sx, sy = sx_ / 1280, sy_ / 720 function dxDrawBorderedText ( text, x, y, w, h, color, scale, font, alignX, alignY, clip, wordBreak, postGUI, color2 ) local wh = 1 local msg_gsub = text if type(text) == 'string' then msg_gsub = text:gsub ( '#%x%x%x%x%x%x', '' ) end dxDrawText ( msg_gsub, x - wh, y - wh, w - wh, h - wh, tocolor ( 0, 0, 0, 255 ), scale, font, alignX, alignY, clip, wordBreak, false ) -- black dxDrawText ( msg_gsub, x + wh, y - wh, w + wh, h - wh, tocolor ( 0, 0, 0, 255 ), scale, font, alignX, alignY, clip, wordBreak, false ) dxDrawText ( msg_gsub, x - wh, y + wh, w - wh, h + wh, tocolor ( 0, 0, 0, 255 ), scale, font, alignX, alignY, clip, wordBreak, false ) dxDrawText ( msg_gsub, x + wh, y + wh, w + wh, h + wh, tocolor ( 0, 0, 0, 255 ), scale, font, alignX, alignY, clip, wordBreak, false ) dxDrawText ( msg_gsub, x - wh, y, w - wh, h, tocolor ( 0, 0, 0, 255 ), scale, font, alignX, alignY, clip, wordBreak, false ) dxDrawText ( msg_gsub, x + wh, y, w + wh, h, tocolor ( 0, 0, 0, 255 ), scale, font, alignX, alignY, clip, wordBreak, false ) dxDrawText ( msg_gsub, x, y - wh, w, h - wh, tocolor ( 0, 0, 0, 255 ), scale, font, alignX, alignY, clip, wordBreak, false ) dxDrawText ( msg_gsub, x, y + wh, w, h + wh, tocolor ( 0, 0, 0, 255 ), scale, font, alignX, alignY, clip, wordBreak, false ) dxDrawText ( text, x, y, w, h, color, scale, font, alignX, alignY, clip, wordBreak, postGUI, color2 ) end font2 = dxCreateFont("Dragon.ttf",10) lol = { } function Dx () lol[1] = tocolor(0, 0, 0, 0) lol[2] = tocolor(0, 0, 0, 0) if ( cursorPosition(sx*343,sy*489,sx*94,sy*46) ) then lol[1] = tocolor(82,137,153) end if ( cursorPosition(sx*561,sy*489,sx*94,sy*46) ) then lol[2] = tocolor(82,137,153) end dxDrawLine(sx*282 - 1,sy*249 - 1,sx*282 - 1,sy*553, tocolor(0, 0, 0, 255), 1, false) dxDrawLine(sx*769,sy*249 - 1,sx*282 - 1,sy*249 - 1, tocolor(0, 0, 0, 255), 1, false) dxDrawLine(sx*282 - 1,sy*553,sx*769,sy*553, tocolor(0, 0, 0, 255), 1, false) dxDrawLine(sx*769,sy*553,sx*769,sy*249 - 1, tocolor(0, 0, 0, 255), 1, false) dxDrawRectangle(sx*282,sy*249,sx*487,sy*304, tocolor(80, 173, 163, 87), false) dxDrawLine(sx*281 - 1,sy*248 - 1,sx*281 - 1,sy*282, tocolor(0, 0, 0, 255), 1, false) dxDrawLine(sx*769,sy*248 - 1,sx*281 - 1,sy*248 - 1, tocolor(0, 0, 0, 255), 1, false) dxDrawLine(sx*281 - 1,sy*282,sx*769,sy*282, tocolor(0, 0, 0, 255), 1, false) dxDrawLine(sx*769,sy*282,sx*769,sy*248 - 1, tocolor(0, 0, 0, 255), 1, false) dxDrawRectangle(sx*281,sy*248,sx*488,sy*34, tocolor(58, 133, 196,255), false) dxDrawBorderedText("",sx*288,sy*329,sx*365,sy*376, tocolor(68, 34, 218, 254), 1.00,font2, "center", "center", false, false, false, true, false) dxDrawBorderedText("",sx*288,sy*390,sx*365,sy*437, tocolor(118, 43, 210, 255), 1.00,font2, "center", "center", false, false, false, true, false) dxDrawLine(sx*343 - 1,sy*489 - 1,sx*343 - 1,sy*535, tocolor(0, 0, 0, 255), 1, false) dxDrawLine(sx*437,sy*489 - 1,sx*343 - 1,sy*489 - 1, tocolor(0, 0, 0, 255), 1, false) dxDrawLine(sx*343 - 1,sy*535,sx*437,sy*535, tocolor(0, 0, 0, 255), 1, false) dxDrawLine(sx*437,sy*535,sx*437,sy*489 - 1, tocolor(0, 0, 0, 255), 1, false) dxDrawRectangle(sx*343,sy*489,sx*94,sy*46,lol[1], false) dxDrawLine(sx*561 - 1,sy*489 - 1,sx*561 - 1,sy*535, tocolor(0, 0, 0, 255), 1, false) dxDrawLine(sx*655,sy*489 - 1,sx*561 - 1,sy*489 - 1, tocolor(0, 0, 0, 255), 1, false) dxDrawLine(sx*561 - 1,sy*535,sx*655,sy*535, tocolor(0, 0, 0, 255), 1, false) dxDrawLine(sx*655,sy*535,sx*655,sy*489 - 1, tocolor(0, 0, 0, 255), 1, false) dxDrawRectangle(sx*561,sy*489,sx*94,sy*46,lol[2], false) dxDrawBorderedText("",sx*345,sy*492,sx*437,sy*535, tocolor(112, 217, 75, 247), 1.00,font2, "center", "center", false, false, false, true, false) dxDrawBorderedText("",sx*563,sy*492,sx*655,sy*535, tocolor(112, 217, 75, 247), 1.00,font2, "center", "center", false, false, false, true, false) dxDrawBorderedText("",sx*332,sy*252,sx*692,sy*277, tocolor(121, 216, 28, 255), 1.00,font2, "center", "center", false, false, false, true, false) dxDrawBorderedText(" ",sx*377,sy*377,sx*542,sy*390, tocolor(255, 255, 255, 255), 1.00,font2, "left", "top",false, false, false, true, true) end addEventHandler("onClientRender", root,Dx) شكرا على المساعده 28 minutes ago, Killer Project said: dxCreateButton "onClientMouseEnter" "onClientMouseLeave" شكرا اخى Link to comment
coNolel Posted March 11, 2017 Share Posted March 11, 2017 سوي dxDrawRectangle في فنكشن و سو لها رندر addEventHandler("onClientRender",.... و سوي حدث onClientClick وسوي تحقق للماوس وتحقق لإحداثيات الـdxDrawRectangle بس لو تبي شي نظيف سوي فنكشي بسيط تغير فيه اسم الفنكشن ويبقى بنفس المفعول مثآل : function dxDrawButton(x,w,y,h,color,PostGUI) dxDrawRectangle(x,w,y,h,color,PostGUI) end Link to comment
AchrefF Posted March 11, 2017 Author Share Posted March 11, 2017 8 minutes ago, coNolel said: سوي dxDrawRectangle في فنكشن و سو لها رندر addEventHandler("onClientRender",.... و سوي حدث onClientClick وسوي تحقق للماوس وتحقق لإحداثيات الـdxDrawRectangle بس لو تبي شي نظيف سوي فنكشي بسيط تغير فيه اسم الفنكشن ويبقى بنفس المفعول مثآل : function dxDrawButton(x,w,y,h,color,PostGUI) dxDrawRectangle(x,w,y,h,color,PostGUI) end شكرا اخى على الافاده 1 Link to comment
Abu-Solo Posted March 11, 2017 Share Posted March 11, 2017 يقدر يسوي زرار عادي ويحط الالفا علي صفر , guiSetAlpha(button,0) Link to comment
^iiEcoo'x_) Posted March 11, 2017 Share Posted March 11, 2017 7 hours ago, AchrefF said: بعرف اعمل زر مخفى بس عوز زر اول ما اشاور عليه ب الماوس يقلب لون تانى 4 hours ago, Abu-Solo said: يقدر يسوي زرار عادي ويحط الالفا علي صفر , guiSetAlpha(button,0) ايش وضعك ؟ Link to comment
Abu-Solo Posted March 12, 2017 Share Posted March 12, 2017 14 hours ago, #_iMr.[E]coo said: ايش وضعك ؟ Sorry ما قريت تعليقه Link to comment
^iiEcoo'x_) Posted March 12, 2017 Share Posted March 12, 2017 3 hours ago, Abu-Solo said: Sorry ما قريت تعليقه حجة مفلس 1 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