Nasa47 Posted July 31, 2014 Posted July 31, 2014 السلام عليكم عندي نافذ مسويه على يمين الشاشة, يطلع عندي مضبوط بس في ناس مايطلع عندهم, او يطلع بس مو كامل, وعفسسة انا ادري اني احتاج guiGetScreenSize() بس مو جاي يضبط مع كل الشاشات هذا الكود sx,sy=guiGetScreenSize() x,y=0.5*sx,0.5*sy dxDrawRectangle(1146, 275, 250, 404, tocolor(0, 0, 0, 180), false) dxDrawText("Test", x + 480, y - 140, 1356, 304, tocolor(255, 255, 255, 255), 0.9, "bankgothic", "center", "center", false,false,false) dxDrawText("Test", x + 475, y - 80, 1356, 338, tocolor(255, 255, 255, 255), 1.50, "default-bold", "left", "center", false,false,false) dxDrawText("Test", x + 475, y - 50, 1356, 369, tocolor(255, 255, 255, 255), 1.50, "default-bold", "left", "center", false,false,false) dxDrawText("Test", x + 475, y - 20, 1356, 400, tocolor(255, 255, 255, 255), 1.50, "default-bold", "left", "center", false,false,false) dxDrawText("Test", x + 475, y + 10, 1356, 431, tocolor(255, 255, 255, 255), 1.50, "default-bold", "left", "center", false,false,false) end
The Don Posted July 31, 2014 Posted July 31, 2014 ومين قال لك ما تضبظ ؟ تضبظ ونص بعد كلام من الويكي : Using guiGetScreenSize to fit GUI & DX drawing in all resolutions
nxFairlywell Posted July 31, 2014 Posted July 31, 2014 فنكشن حسن الي عطاني زاحف ------------- -- Screen ------------- function guiSetPositionAllScreen(wnd,ScreenH,ScreenW) local LocalScreenH,LocalScreenW = guiGetScreenSize() if ( isElement(wnd) ) then if ( ScreenH and ScreenW ) then local x,y = guiGetPosition(wnd,false) guiSetPosition(wnd,LocalScreenH*(x/ScreenH),LocalScreenW*(y/ScreenW),false) end end end
Nasa47 Posted July 31, 2014 Author Posted July 31, 2014 فنكشن حسن الي عطاني زاحف ------------- -- Screen ------------- function guiSetPositionAllScreen(wnd,ScreenH,ScreenW) local LocalScreenH,LocalScreenW = guiGetScreenSize() if ( isElement(wnd) ) then if ( ScreenH and ScreenW ) then local x,y = guiGetPosition(wnd,false) guiSetPosition(wnd,LocalScreenH*(x/ScreenH),LocalScreenW*(y/ScreenW),false) end end end زي ماتشوف انا استخدم dx
#DRAGON!FIRE Posted July 31, 2014 Posted July 31, 2014 ولله شف في اكثر من طريقة عشان تسويها لكل الشاشات جرب هذي الطريقة .. : local sX, sY = guiGetScreenSize ( ); local pX = (sX/800)*200 local pY = (sY/600)*200 800, 600 = مقاس شاشتكـ 200 = x, y الاحداثيات
iMr.TZ[W]ER Posted July 31, 2014 Posted July 31, 2014 ولله شف في اكثر من طريقة عشان تسويها لكل الشاشاتجرب هذي الطريقة .. : local sX, sY = guiGetScreenSize ( ); local pX = (sX/800)*200 local pY = (sY/600)*200 800, 600 = مقاس شاشتكـ 200 = x, y الاحداثيات تيش هي ال 200 ؟
#DRAGON!FIRE Posted July 31, 2014 Posted July 31, 2014 مجرد رقم كـ مثال حق الدي اكس x الـ 200 الاولة هي الاحداثي # حق الدي اكس y الـ 200 الثاني هي الاحداثي # ! ( . بنفس الطريقة w, h ويسوي الـ ) #
Nasa47 Posted July 31, 2014 Author Posted July 31, 2014 ولله شف في اكثر من طريقة عشان تسويها لكل الشاشاتجرب هذي الطريقة .. : local sX, sY = guiGetScreenSize ( ); local pX = (sX/800)*200 local pY = (sY/600)*200 800, 600 = مقاس شاشتكـ 200 = x, y الاحداثيات تطلع ملخبطة وحدة داخل وحدة + ابي لكل الشاشات مو ب 800, 600
#DRAGON!FIRE Posted July 31, 2014 Posted July 31, 2014 مالها دخل .. هذي عمليات حسابية عشان تجي لكل الشاشات . وش مقاس شاشتكـ ؟ .. + ورني وش سويت
Nasa47 Posted July 31, 2014 Author Posted July 31, 2014 شاشتي : 1366 x 768 وهذا اللي سويته local sX, sY = guiGetScreenSize ( ); local pX = (sX/800)*200 local pY = (sY/600)*200 dxDrawRectangle(1146, 275, 250, 404, tocolor(0, 0, 0, 180), false) dxDrawText("Test", x , y, 1356, 304, tocolor(255, 255, 255, 255), 0.9, "bankgothic", "center", "center", false,false,false) dxDrawText("Test", x , y, 1356, 338, tocolor(255, 255, 255, 255), 1.50, "default-bold", "left", "center", false,false,false) dxDrawText("Test", x , y, 1356, 369, tocolor(255, 255, 255, 255), 1.50, "default-bold", "left", "center", false,false,false) dxDrawText("Test", x , y, 1356, 400, tocolor(255, 255, 255, 255), 1.50, "default-bold", "left", "center", false,false,false) dxDrawText("Test", x , y, 1356, 431, tocolor(255, 255, 255, 255), 1.50, "default-bold", "left", "center", false,false,false)
nxFairlywell Posted July 31, 2014 Posted July 31, 2014 شاشتي :1366 x 768 وهذا اللي سويته local sX, sY = guiGetScreenSize ( ); local pX = (sX/800)*200 local pY = (sY/600)*200 dxDrawRectangle(1146, 275, 250, 404, tocolor(0, 0, 0, 180), false) dxDrawText("Test", x , y, 1356, 304, tocolor(255, 255, 255, 255), 0.9, "bankgothic", "center", "center", false,false,false) dxDrawText("Test", x , y, 1356, 338, tocolor(255, 255, 255, 255), 1.50, "default-bold", "left", "center", false,false,false) dxDrawText("Test", x , y, 1356, 369, tocolor(255, 255, 255, 255), 1.50, "default-bold", "left", "center", false,false,false) dxDrawText("Test", x , y, 1356, 400, tocolor(255, 255, 255, 255), 1.50, "default-bold", "left", "center", false,false,false) dxDrawText("Test", x , y, 1356, 431, tocolor(255, 255, 255, 255), 1.50, "default-bold", "left", "center", false,false,false) جرب الكود هذا , جانب كلنت ---- dxDrawRectangle(1146, 275, 250, 404, tocolor(0, 0, 0, 180), false) dxDrawText("Test", x , y, 1356, 304, tocolor(255, 255, 255, 255), 0.9, "bankgothic", "center", "center", false,false,false) dxDrawText("Test", x , y, 1356, 338, tocolor(255, 255, 255, 255), 1.50, "default-bold", "left", "center", false,false,false) dxDrawText("Test", x , y, 1356, 369, tocolor(255, 255, 255, 255), 1.50, "default-bold", "left", "center", false,false,false) dxDrawText("Test", x , y, 1356, 400, tocolor(255, 255, 255, 255), 1.50, "default-bold", "left", "center", false,false,false) dxDrawText("Test", x , y, 1356, 431, tocolor(255, 255, 255, 255), 1.50, "default-bold", "left", "center", false,false,false) function guiSetPositionAllScreen(MyWindow,ScreenH,ScreenW) local LocalScreenH,LocalScreenW = guiGetScreenSize() if ( isElement(MyWindow) ) then if ( ScreenH and ScreenW ) then local x,y = guiGetPosition(MyWindow,false) guiSetPosition(MyWindow,LocalScreenH*(x/ScreenH),LocalScreenW*(y/ScreenW),false) end end end guiSetPositionAllScreen(MyWindow,1366,768) ----- هذا الفنكشن ضروري تحطه في حدث عند تشغيل السكربت حدث تشغيل السكربت الي اقصده addEventHandler("onClientResourceStrat", resourceRoot, function() MyWindow = GUIEditor.window(....) guiSetPositionAllScreen(MyWindow,1366,768) ------- يصير هنا بعد الكود الي فوق end ) +++ لاتنسى تستبدل MyWindow الى اسم لوحتك
Nasa47 Posted July 31, 2014 Author Posted July 31, 2014 شاشتي :1366 x 768 وهذا اللي سويته local sX, sY = guiGetScreenSize ( ); local pX = (sX/800)*200 local pY = (sY/600)*200 dxDrawRectangle(1146, 275, 250, 404, tocolor(0, 0, 0, 180), false) dxDrawText("Test", x , y, 1356, 304, tocolor(255, 255, 255, 255), 0.9, "bankgothic", "center", "center", false,false,false) dxDrawText("Test", x , y, 1356, 338, tocolor(255, 255, 255, 255), 1.50, "default-bold", "left", "center", false,false,false) dxDrawText("Test", x , y, 1356, 369, tocolor(255, 255, 255, 255), 1.50, "default-bold", "left", "center", false,false,false) dxDrawText("Test", x , y, 1356, 400, tocolor(255, 255, 255, 255), 1.50, "default-bold", "left", "center", false,false,false) dxDrawText("Test", x , y, 1356, 431, tocolor(255, 255, 255, 255), 1.50, "default-bold", "left", "center", false,false,false) جرب الكود هذا , جانب كلنت ---- dxDrawRectangle(1146, 275, 250, 404, tocolor(0, 0, 0, 180), false) dxDrawText("Test", x , y, 1356, 304, tocolor(255, 255, 255, 255), 0.9, "bankgothic", "center", "center", false,false,false) dxDrawText("Test", x , y, 1356, 338, tocolor(255, 255, 255, 255), 1.50, "default-bold", "left", "center", false,false,false) dxDrawText("Test", x , y, 1356, 369, tocolor(255, 255, 255, 255), 1.50, "default-bold", "left", "center", false,false,false) dxDrawText("Test", x , y, 1356, 400, tocolor(255, 255, 255, 255), 1.50, "default-bold", "left", "center", false,false,false) dxDrawText("Test", x , y, 1356, 431, tocolor(255, 255, 255, 255), 1.50, "default-bold", "left", "center", false,false,false) function guiSetPositionAllScreen(MyWindow,ScreenH,ScreenW) local LocalScreenH,LocalScreenW = guiGetScreenSize() if ( isElement(MyWindow) ) then if ( ScreenH and ScreenW ) then local x,y = guiGetPosition(MyWindow,false) guiSetPosition(MyWindow,LocalScreenH*(x/ScreenH),LocalScreenW*(y/ScreenW),false) end end end guiSetPositionAllScreen(MyWindow,1366,768) ----- هذا الفنكشن ضروري تحطه في حدث عند تشغيل السكربت حدث تشغيل السكربت الي اقصده addEventHandler("onClientResourceStrat", resourceRoot, function() MyWindow = GUIEditor.window(....) guiSetPositionAllScreen(MyWindow,1366,768) ------- يصير هنا بعد الكود الي فوق end ) +++ لاتنسى تستبدل MyWindow الى اسم لوحتك ماعندي لوحة, بس dx elements
The Don Posted July 31, 2014 Posted July 31, 2014 شاشتي :1366 x 768 وهذا اللي سويته local sX, sY = guiGetScreenSize ( ); local pX = (sX/800)*200 local pY = (sY/600)*200 dxDrawRectangle(1146, 275, 250, 404, tocolor(0, 0, 0, 180), false) dxDrawText("Test", x , y, 1356, 304, tocolor(255, 255, 255, 255), 0.9, "bankgothic", "center", "center", false,false,false) dxDrawText("Test", x , y, 1356, 338, tocolor(255, 255, 255, 255), 1.50, "default-bold", "left", "center", false,false,false) dxDrawText("Test", x , y, 1356, 369, tocolor(255, 255, 255, 255), 1.50, "default-bold", "left", "center", false,false,false) dxDrawText("Test", x , y, 1356, 400, tocolor(255, 255, 255, 255), 1.50, "default-bold", "left", "center", false,false,false) dxDrawText("Test", x , y, 1356, 431, tocolor(255, 255, 255, 255), 1.50, "default-bold", "left", "center", false,false,false) جرب الكود هذا , جانب كلنت ---- dxDrawRectangle(1146, 275, 250, 404, tocolor(0, 0, 0, 180), false) dxDrawText("Test", x , y, 1356, 304, tocolor(255, 255, 255, 255), 0.9, "bankgothic", "center", "center", false,false,false) dxDrawText("Test", x , y, 1356, 338, tocolor(255, 255, 255, 255), 1.50, "default-bold", "left", "center", false,false,false) dxDrawText("Test", x , y, 1356, 369, tocolor(255, 255, 255, 255), 1.50, "default-bold", "left", "center", false,false,false) dxDrawText("Test", x , y, 1356, 400, tocolor(255, 255, 255, 255), 1.50, "default-bold", "left", "center", false,false,false) dxDrawText("Test", x , y, 1356, 431, tocolor(255, 255, 255, 255), 1.50, "default-bold", "left", "center", false,false,false) function guiSetPositionAllScreen(MyWindow,ScreenH,ScreenW) local LocalScreenH,LocalScreenW = guiGetScreenSize() if ( isElement(MyWindow) ) then if ( ScreenH and ScreenW ) then local x,y = guiGetPosition(MyWindow,false) guiSetPosition(MyWindow,LocalScreenH*(x/ScreenH),LocalScreenW*(y/ScreenW),false) end end end guiSetPositionAllScreen(MyWindow,1366,768) ----- هذا الفنكشن ضروري تحطه في حدث عند تشغيل السكربت حدث تشغيل السكربت الي اقصده addEventHandler("onClientResourceStrat", resourceRoot, function() MyWindow = GUIEditor.window(....) guiSetPositionAllScreen(MyWindow,1366,768) ------- يصير هنا بعد الكود الي فوق end ) +++ لاتنسى تستبدل MyWindow الى اسم لوحتك الفنكشن حق حسن مختص بـ النوافذ وش دخلها في الدي اكس وتقول له تستبدل ومادري وش وكوده كله مافي نافذه كله دي اكس وين البازوكا عطوني اياها بالنسبه لصاحب الموضوع امسك سويته لك لكن انت عدل الاحدثيات لان لازم لها رياضيات local x,y = guiGetScreenSize() dxDrawRectangle(x/2-200,y/2-200, 250, 404, tocolor(0, 0, 0, 180), false) dxDrawText("Test", x/2-200,y/2-200, 1356, 304, tocolor(255, 255, 255, 255), 0.9, "bankgothic", "center", "center", false,false,false) dxDrawText("Test", x/2-200,y/2-200, 1356, 338, tocolor(255, 255, 255, 255), 1.50, "default-bold", "left", "center", false,false,false) dxDrawText("Test", x/2-200,y/2-200, 1356, 369, tocolor(255, 255, 255, 255), 1.50, "default-bold", "left", "center", false,false,false) dxDrawText("Test", x/2-200,y/2-200, 1356, 400, tocolor(255, 255, 255, 255), 1.50, "default-bold", "left", "center", false,false,false) dxDrawText("Test", x/2-200,y/2-200, 1356, 431, tocolor(255, 255, 255, 255), 1.50, "default-bold", "left", "center", false,false,false) end
#DRAGON!FIRE Posted July 31, 2014 Posted July 31, 2014 هريس .. مدري وش تقصد بها استبدلها لرقم x, y بالـ تكست حاط local sX, sY = guiGetScreenSize ( ); function DxFunction ( ) dxDrawRectangle((sX/1366)*1146, (sY/768)*275, (sX/1366)*250, (sY/768)*404, tocolor(0, 0, 0, 180), false) dxDrawText("Test", (sX/1366)*x, (sY/768)*y, (sX/1366)*1356, (sY/768)*431, tocolor(255, 255, 255, 255), 1.50, "default-bold", "left", "center", false,false,false) end addEventHandler ( "onClientRender", root, DxFunction )
Nasa47 Posted July 31, 2014 Author Posted July 31, 2014 هريس .. مدري وش تقصد بها استبدلها لرقم x, y بالـ تكست حاط local sX, sY = guiGetScreenSize ( ); function DxFunction ( ) dxDrawRectangle((sX/1366)*1146, (sY/768)*275, (sX/1366)*250, (sY/768)*404, tocolor(0, 0, 0, 180), false) dxDrawText("Test", (sX/1366)*x, (sY/768)*y, (sX/1366)*1356, (sY/768)*431, tocolor(255, 255, 255, 255), 1.50, "default-bold", "left", "center", false,false,false) end addEventHandler ( "onClientRender", root, DxFunction ) Works perfectly, thanks mate
nxFairlywell Posted July 31, 2014 Posted July 31, 2014 بالنسبه لصاحب الموضوع امسك سويته لك لكن انت عدل الاحدثيات لان لازم لها رياضيات local x,y = guiGetScreenSize() dxDrawRectangle(x/2-200,y/2-200, 250, 404, tocolor(0, 0, 0, 180), false) dxDrawText("Test", x/2-200,y/2-200, 1356, 304, tocolor(255, 255, 255, 255), 0.9, "bankgothic", "center", "center", false,false,false) dxDrawText("Test", x/2-200,y/2-200, 1356, 338, tocolor(255, 255, 255, 255), 1.50, "default-bold", "left", "center", false,false,false) dxDrawText("Test", x/2-200,y/2-200, 1356, 369, tocolor(255, 255, 255, 255), 1.50, "default-bold", "left", "center", false,false,false) dxDrawText("Test", x/2-200,y/2-200, 1356, 400, tocolor(255, 255, 255, 255), 1.50, "default-bold", "left", "center", false,false,false) dxDrawText("Test", x/2-200,y/2-200, 1356, 431, tocolor(255, 255, 255, 255), 1.50, "default-bold", "left", "center", false,false,false) end بعدين كودك هريسه وانت اهرس منه
Nasa47 Posted July 31, 2014 Author Posted July 31, 2014 بالنسبه لصاحب الموضوع امسك سويته لك لكن انت عدل الاحدثيات لان لازم لها رياضيات local x,y = guiGetScreenSize() dxDrawRectangle(x/2-200,y/2-200, 250, 404, tocolor(0, 0, 0, 180), false) dxDrawText("Test", x/2-200,y/2-200, 1356, 304, tocolor(255, 255, 255, 255), 0.9, "bankgothic", "center", "center", false,false,false) dxDrawText("Test", x/2-200,y/2-200, 1356, 338, tocolor(255, 255, 255, 255), 1.50, "default-bold", "left", "center", false,false,false) dxDrawText("Test", x/2-200,y/2-200, 1356, 369, tocolor(255, 255, 255, 255), 1.50, "default-bold", "left", "center", false,false,false) dxDrawText("Test", x/2-200,y/2-200, 1356, 400, tocolor(255, 255, 255, 255), 1.50, "default-bold", "left", "center", false,false,false) dxDrawText("Test", x/2-200,y/2-200, 1356, 431, tocolor(255, 255, 255, 255), 1.50, "default-bold", "left", "center", false,false,false) end بعدين كودك هريسه وانت اهرس منه Calm down
The Don Posted July 31, 2014 Posted July 31, 2014 هريسه اجل ي بكس :\ شوف الكود شغال لكن لازم له تعديل احدثيات .. نظام البزرنه والدرعمه ذا ما يمشي عندي اوك ؟ +
nxFairlywell Posted July 31, 2014 Posted July 31, 2014 هريسه اجل ي بكس :\شوف الكود شغال لكن لازم له تعديل احدثيات .. نظام البزرنه والدرعمه ذا ما يمشي عندي اوك ؟ + انا ماجيت اطرح له كود جاهز لأني في بدايتي ماحصلت اكواد جاهزه كذا ماراح يتعلم ثاني شيء البزر انت جاي مدرعم علي كودك خطأ ياخي انطم واطرح كودك وانت ساكت لأني مايعجبني اخذ واعطي مع ناس مثلك ثالث شيء مجرب الكود وحدك ومصوره وش الفايده من الكود اذا كان يشغل المود على شاشتك
The Don Posted July 31, 2014 Posted July 31, 2014 ههههههههههههههههههههههههههههههههههههههههههههههههههههههههههههههههههههههههههههههههههههههههههههههههههههههههههههههههههههههههههههههههه الله لا تبلانا حلوه " انا ما جيت اطرح له كود جاهز " ههههههههه محسسني اننا ميتين عليك الحين ههههههههههههههههههههههههههههه وكمان وش دخلك ! منت لا صاحب الموضوع ولا تساعد جاي بس شغال درعمه وزياده مشاركات يالله لك الحمد اذا مسوي العضويه ومنت جاي تساعد الناس وجاي تردعم على الشعب فـ الله لايهينك سقها من المنتدى واطلع لان اشكالك كثار هنيا -.- يلا شقلب بس :\ بزرنه اخر رد لي مع صغار العقول
nxFairlywell Posted August 1, 2014 Posted August 1, 2014 هههههههههههههههههههههههههههههههههههههههههههههههههههههههههههههههههههههههههههههههههههههههههههههههههههههههههههههههههههههههههههههههههالله لا تبلانا حلوه " انا ما جيت اطرح له كود جاهز " ههههههههه محسسني اننا ميتين عليك الحين ههههههههههههههههههههههههههههه وكمان وش دخلك ! منت لا صاحب الموضوع ولا تساعد جاي بس شغال درعمه وزياده مشاركات يالله لك الحمد اذا مسوي العضويه ومنت جاي تساعد الناس وجاي تردعم على الشعب فـ الله لايهينك سقها من المنتدى واطلع لان اشكالك كثار هنيا -.- يلا شقلب بس :\ بزرنه اخر رد لي مع صغار العقول والله مالبزر الانت اصلا من شفت كلامك عرفت انك بزر جاي هنا تفرغ الطاقه ++ زيادة مشاركات ليه ؟ ههههههه المشاركات هنا مامنها فائده خذها معلومه ذذ ++ المنتدى ماهو حلالك عشان اطلع منه شاريه شي ونا مادري نسأل الله العفو والعافيه برب
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