hussein29 Posted June 7, 2014 Share Posted June 7, 2014 السلام عليكم ابي طلب بسيط وهو انكم اتشوفو وش الخطأ في دا الكود addEventHandler("onClientRender", root, function() dxDrawRectangle(708, 243, 81, 26, tocolor(0, 0, 0, 255), true) dxDrawRectangle(709, 244, 79, 24, tocolor(185, 185, 185, 255), true) end ) addEventHandler("onClientMouseEnter", root, function(709, 244) dxDrawRectangle(709, 244, 79, 24, tocolor(0, 0, 0, 255), true) end ) شرح الاكواد : .الاكواد دي تصنع شكل اذا مر فوقة الماوس يتغير لونة. انا في انتظار ردودكم Link to comment
#Rmad~> Posted June 7, 2014 Share Posted June 7, 2014 R,G,B = 185,185,185 R = guiCreateButton(709,244,79,24,"",false) guiSetAlpha(R,0) addEventHandler("onClientMouseEnter",R,onEnter) addEventHandler("onClientMouseLeave",R,onLeave) function Draw () dxDrawRectangle(709,244,79,24,tocolor(R,G,B,255),true) end addEventHandler ("onClientRender",getRootElement(),Draw) function onEnter() R,G,B = 255,0,255 end function onLeave() R,G,B = 185,185,185 end الطريقة ذي اسهل وتتيح لك طرق اسهل واكثر للاستخدام . Link to comment
hussein29 Posted June 7, 2014 Author Share Posted June 7, 2014 اوك راح اجربها ومشكوور مقدما Link to comment
hussein29 Posted June 7, 2014 Author Share Posted June 7, 2014 R,G,B = 185,185,185 R = guiCreateButton(709,244,79,24,"",false) guiSetAlpha(R,0) addEventHandler("onClientMouseEnter",R,onEnter) addEventHandler("onClientMouseLeave",R,onLeave) function Draw () dxDrawRectangle(709,244,79,24,tocolor(R,G,B,255),true) end addEventHandler ("onClientRender",getRootElement(),Draw) function onEnter() R,G,B = 255,0,255 end function onLeave() R,G,B = 185,185,185 end الطريقة ذي اسهل وتتيح لك طرق اسهل واكثر للاستخدام . الاكواد مش شغالة الزر يطلع بس مايتغير لونة Link to comment
acount deleted Posted June 7, 2014 Share Posted June 7, 2014 انت تبي تغير لون ازر لما تجي فوقه الماوس؟ Link to comment
hussein29 Posted June 7, 2014 Author Share Posted June 7, 2014 انت تبي تغير لون ازر لما تجي فوقه الماوس؟ يب Link to comment
acount deleted Posted June 7, 2014 Share Posted June 7, 2014 R = guiCreateButton(709,244,79,24,"", false) guiSetAlpha(R,0) addEventHandler("onClientMouseEnter", root, function() guiSetProperty(R,"NormalTextColour", "FF0000") end ) addEventHandler("onClientMouseLeave", root, function() guiSetProperty(R,"NormalTextColour", "FFFFFF") end ) Link to comment
#Rmad~> Posted June 7, 2014 Share Posted June 7, 2014 R,G,B = 185,185,185 R = guiCreateButton(709,244,79,24,"",false) guiSetAlpha(R,0) addEventHandler("onClientMouseEnter",R,onEnter) addEventHandler("onClientMouseLeave",R,onLeave) function Draw () dxDrawRectangle(709,244,79,24,tocolor(R,G,B,255),true) end addEventHandler ("onClientRender",getRootElement(),Draw) function onEnter() R,G,B = 255,0,255 end function onLeave() R,G,B = 185,185,185 end الطريقة ذي اسهل وتتيح لك طرق اسهل واكثر للاستخدام . الاكواد مش شغالة الزر يطلع بس مايتغير لونة -_-" الكود شغال شوف وش يطلع لك بالديبوق Link to comment
acount deleted Posted June 7, 2014 Share Posted June 7, 2014 R,G,B = 185,185,185 R = guiCreateButton(709,244,79,24,"",false) guiSetAlpha(R,0) addEventHandler("onClientMouseEnter",R,onEnter) addEventHandler("onClientMouseLeave",R,onLeave) function Draw () dxDrawRectangle(709,244,79,24,tocolor(R,G,B,255),true) end addEventHandler ("onClientRender",getRootElement(),Draw) function onEnter() R,G,B = 255,0,255 end function onLeave() R,G,B = 185,185,185 end الطريقة ذي اسهل وتتيح لك طرق اسهل واكثر للاستخدام . الاكواد مش شغالة الزر يطلع بس مايتغير لونة -_-" الكود شغال شوف وش يطلع لك بالديبوق جربته انت؟ Link to comment
#Rmad~> Posted June 7, 2014 Share Posted June 7, 2014 لول معليش مانتبهت للايفنات هاذا شغال R,G,B = 185,185,185 R = guiCreateButton(709,244,79,24,"",false) guiSetAlpha(R,0) function Draw () dxDrawRectangle(709,244,79,24,tocolor(R,G,B,255),true) end addEventHandler ("onClientRender",getRootElement(),Draw) function onEnter() R,G,B = 255,0,255 end addEventHandler("onClientMouseEnter",R,onEnter) function onLeave() R,G,B = 185,185,185 end addEventHandler("onClientMouseLeave",R,onLeave) Link to comment
acount deleted Posted June 7, 2014 Share Posted June 7, 2014 R = guiCreateButton(709,244,79,24,"", false) guiSetAlpha(R,0) addEventHandler("onClientMouseEnter", root, function() guiSetProperty(R,"NormalTextColour", "FF0000") end ) addEventHandler("onClientMouseLeave", root, function() guiSetProperty(R,"NormalTextColour", "FFFFFF") end ) Link to comment
#Rmad~> Posted June 7, 2014 Share Posted June 7, 2014 شرح الاكواد : الاكواد ديتصنع شكل اذا مر فوقة الماوس يتغير لونة. dxDrawRectangle(709, 244, 79, 24, tocolor(0, 0, 0, 255), true) Link to comment
acount deleted Posted June 7, 2014 Share Posted June 7, 2014 كنت احسبه يقصد زر مو ركتنقل انت تبي تغير لون ازر لما تجي فوقه الماوس؟ يب Link to comment
hussein29 Posted June 7, 2014 Author Share Posted June 7, 2014 لول معليش مانتبهت للايفناتهاذا شغال R,G,B = 185,185,185 R = guiCreateButton(709,244,79,24,"",false) guiSetAlpha(R,0) function Draw () dxDrawRectangle(709,244,79,24,tocolor(R,G,B,255),true) end addEventHandler ("onClientRender",getRootElement(),Draw) function onEnter() R,G,B = 255,0,255 end addEventHandler("onClientMouseEnter",R,onEnter) function onLeave() R,G,B = 185,185,185 end addEventHandler("onClientMouseLeave",R,onLeave) مشكوووور لكل الي شاركو واسف على الازعاج الي سببتو لاكن الاكواد الاولة مشتغلة عندي مدري ليه لاكن دي الاكواد اشتغلة يعطيكم العافية ماشاء الله الاستجابة سريعة لدرجة اني ماقدرة الحق ارد عليكم Link to comment
#Rmad~> Posted June 7, 2014 Share Posted June 7, 2014 لول معليش مانتبهت للايفناتهاذا شغال R,G,B = 185,185,185 R = guiCreateButton(709,244,79,24,"",false) guiSetAlpha(R,0) function Draw () dxDrawRectangle(709,244,79,24,tocolor(R,G,B,255),true) end addEventHandler ("onClientRender",getRootElement(),Draw) function onEnter() R,G,B = 255,0,255 end addEventHandler("onClientMouseEnter",R,onEnter) function onLeave() R,G,B = 185,185,185 end addEventHandler("onClientMouseLeave",R,onLeave) مشكوووور لكل الي شاركو واسف على الازعاج الي سببتو لاكن الاكواد الاولة مشتغلة عندي مدري ليه لاكن دي الاكواد اشتغلة يعطيكم العافية ماشاء الله الاستجابة سريعة لدرجة اني ماقدرة الحق ارد عليكم اخر كود عطيتك اياه مجربه قبل مانزلته لك شغله وافتح الديبوق وقلي وش يجيك Link to comment
hussein29 Posted June 7, 2014 Author Share Posted June 7, 2014 طلب ثاني هل من الممكن اختصار اكثر من زر؟ ادا كان نعم كيف Link to comment
hussein29 Posted June 7, 2014 Author Share Posted June 7, 2014 مثلا ابي اصمم زر ثاني شوف كم سطر راح اخذ هل يمكن تقليل الاسطر R = guiCreateButton(709,244,79,24,"",false) --الزر الاول guiSetAlpha(R,0) f = guiCreateButton(709,244,79,24,"",false) --الزر الثاني guiSetAlpha(R,0) function Draw () dxDrawRectangle(709,244,79,24,tocolor(R,G,B,255),true) --الزر الاول dxDrawRectangle(709,244,79,24,tocolor(Ra,Ga,Ba,255),true) --الزر الثاني end addEventHandler ("onClientRender",getRootElement(),Draw) function onEnter() --الزر الاول R,G,B = 0,0,0 end addEventHandler("onClientMouseEnter",R,onEnter) function onLeave() --الزر الاول R,G,B = 185,185,185 end addEventHandler("onClientMouseLeave",R,onLeave) function onEnter_1() --الزر الثاني Ra,Ga,Ba = 0,0,0 end addEventHandler("onClientMouseEnter",f,onEnter_1) function onLeave_1() --الزر الثاني Ra,Ga,Ba = 185,185,185 end addEventHandler("onClientMouseLeave",f,onLeave_1) Link to comment
#DRAGON!FIRE Posted June 7, 2014 Share Posted June 7, 2014 (edited) ما يحتاج تستخدمون لبل مخفي ومدري وش بالنسبة للزرين .. سوي زي بالجدول وسوي زي الطريقة ذذ ومسوي لك ريتنكقل ثاني ويمديكـ تضيف local sX, sY = guiGetScreenSize( ); local colors = { [ "Rectangle" ] = { 255, 255, 255, 255 }, [ "Rectangle2" ] = { 255, 255, 255, 255 }, } addEventHandler ( "onClientRender", root, function( ) dxDrawRectangle( 709, 244, 79, 24, tocolor(colors[ "Rectangle" ][1],colors[ "Rectangle" ][2],colors[ "Rectangle" ][3],colors[ "Rectangle" ][4]),true ) if ( isCursorShowing( ) == true ) then local cx, cy = getCursorPosition( ) if ( cx*sX >= 709 and cx*sX <= 709+79 and cy*sY >= 244 and cy*sY <= 244+24 ) then colors[ "Rectangle" ][1] = 255 colors[ "Rectangle" ][2] = 0 colors[ "Rectangle" ][3] = 100 colors[ "Rectangle" ][4] = 255 else colors[ "Rectangle" ][1] = 255 colors[ "Rectangle" ][2] = 255 colors[ "Rectangle" ][3] = 255 colors[ "Rectangle" ][4] = 255 end end end ) Edited June 8, 2014 by Guest Link to comment
hussein29 Posted June 8, 2014 Author Share Posted June 8, 2014 ما يحتاج تستخدمون لبل مخفي ومدري وش بالنسبة للزرين .. سوي زي بالجدول وسوي زي الطريقة ذذ ومسوي لك ريتنكقل ثاني ويمديكـ تضيف local sX, sY = guiGetScreenSize( ); local colors = { [ "Rectangle" ] = { 255, 255, 255, 255 } [ "Rectangle2" ] = { 255, 255, 255, 255 } } addEventHandler ( "onClientRender", root, function( ) dxDrawRectangle( 709, 244, 79, 24, tocolor(colors[ "Rectangle" ][1],colors[ "Rectangle" ][2],colors[ "Rectangle" ][3],colors[ "Rectangle" ][4]),true ) if ( isCursorShowing( ) == true ) then local cx, cy = getCursorPosition( ) if ( cx*sX >= 709 and cx*sX <= 709+79 and cy*sY >= 244 and cy*sY <= 244+24 ) then colors[ "Rectangle" ][1] = 255 colors[ "Rectangle" ][2] = 0 colors[ "Rectangle" ][3] = 100 colors[ "Rectangle" ][4] = 255 else colors[ "Rectangle" ][1] = 255 colors[ "Rectangle" ][2] = 255 colors[ "Rectangle" ][3] = 255 colors[ "Rectangle" ][4] = 255 end end end ) مشكووور لاكن هل دي الكواد كاملة او شغالة لأنها مااشتغلة عندي Link to comment
#DRAGON!FIRE Posted June 8, 2014 Share Posted June 8, 2014 %شغالة 100 انا سويت لكـ كـ مثال بسيط .. وانت سوي زيه Link to comment
jafar Posted June 8, 2014 Share Posted June 8, 2014 ما يحتاج تستخدمون لبل مخفي ومدري وش بالنسبة للزرين .. سوي زي بالجدول وسوي زي الطريقة ذذ ومسوي لك ريتنكقل ثاني ويمديكـ تضيف local sX, sY = guiGetScreenSize( ); local colors = { [ "Rectangle" ] = { 255, 255, 255, 255 } [ "Rectangle2" ] = { 255, 255, 255, 255 } } addEventHandler ( "onClientRender", root, function( ) dxDrawRectangle( 709, 244, 79, 24, tocolor(colors[ "Rectangle" ][1],colors[ "Rectangle" ][2],colors[ "Rectangle" ][3],colors[ "Rectangle" ][4]),true ) if ( isCursorShowing( ) == true ) then local cx, cy = getCursorPosition( ) if ( cx*sX >= 709 and cx*sX <= 709+79 and cy*sY >= 244 and cy*sY <= 244+24 ) then colors[ "Rectangle" ][1] = 255 colors[ "Rectangle" ][2] = 0 colors[ "Rectangle" ][3] = 100 colors[ "Rectangle" ][4] = 255 else colors[ "Rectangle" ][1] = 255 colors[ "Rectangle" ][2] = 255 colors[ "Rectangle" ][3] = 255 colors[ "Rectangle" ][4] = 255 end end end ) ناقص عندك الفواصل ف الجدول . Link to comment
#DRAGON!FIRE Posted June 8, 2014 Share Posted June 8, 2014 ما يحتاج تستخدمون لبل مخفي ومدري وش بالنسبة للزرين .. سوي زي بالجدول وسوي زي الطريقة ذذ ومسوي لك ريتنكقل ثاني ويمديكـ تضيف local sX, sY = guiGetScreenSize( ); local colors = { [ "Rectangle" ] = { 255, 255, 255, 255 } [ "Rectangle2" ] = { 255, 255, 255, 255 } } addEventHandler ( "onClientRender", root, function( ) dxDrawRectangle( 709, 244, 79, 24, tocolor(colors[ "Rectangle" ][1],colors[ "Rectangle" ][2],colors[ "Rectangle" ][3],colors[ "Rectangle" ][4]),true ) if ( isCursorShowing( ) == true ) then local cx, cy = getCursorPosition( ) if ( cx*sX >= 709 and cx*sX <= 709+79 and cy*sY >= 244 and cy*sY <= 244+24 ) then colors[ "Rectangle" ][1] = 255 colors[ "Rectangle" ][2] = 0 colors[ "Rectangle" ][3] = 100 colors[ "Rectangle" ][4] = 255 else colors[ "Rectangle" ][1] = 255 colors[ "Rectangle" ][2] = 255 colors[ "Rectangle" ][3] = 255 colors[ "Rectangle" ][4] = 255 end end 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