xFabel 16 Posted August 13 (edited) سلآمم عليكمء 🙄 صرآحه فيه شي عقدني كثير في برمجه الريزلوشنء آدري بعض الناس تقول سهل وكذا جربت بعض كل اكواد ومافي حل صرآحه وحتي كمان relative م يزبط 😞بالله حل بدي كود يزبط لي الرزلوشن علي كل آعدادات 1920x1080 آسف علي جوده local screenW,screenH = guiGetScreenSize() local resW,resH = 1280,720 local sW,sH = (screenW/resW), (screenH/resH) كود الاول كود حقي _dxDrawImage2 = dxDrawImage _dxDrawRectangle2 = dxDrawRectangle _dxDrawText2 = dxDrawText _dxDrawLine2 = dxDrawLine local screenW, screenH = guiGetScreenSize() local sx, sy = guiGetScreenSize ( ); local sx, sy = ( sx / 1280 ), ( sy / 720 ); function _dxDrawImage ( x, y, w, h, filename, ... ) if ( ... ) then _dxDrawImage2 ( x * sx, y * sy, w * sx, h * sy, filename, ... ); else _dxDrawImage2 ( x * sx, y * sy, w * sx, h * sy, filename ); end end function _dxDrawRectangle ( x, y, w, h, ... ) if ( ... ) then _dxDrawRectangle2 ( x * sx, y * sy, w * sx, h * sy, ... ); else _dxDrawRectangle2 ( x * sx, y * sy, w * sx, h * sy ); end end function _dxDrawText ( text, x, y, w, h, ... ) local w, h = w or 0, h or 0 if ( ... ) then _dxDrawText2 ( text, x * sx, y * sy, w * sx, h * sy, ... ); else _dxDrawText2 ( text, x * sx, y * sy, w * sx, h * sy ); end end function _dxDrawLine ( x, y, w, h, clr, ... ) if ( ... ) then _dxDrawLine2 ( x * sx, y * sy, w * sx, h * sy, clr, ... ); else _dxDrawLine2 ( x * sx, y * sy, w * sx, h * sy, clr ); end end Edited August 13 by liwahadri Share this post Link to post
Bassam*Syria 12 Posted August 13 السلام عليكم ذا مثال اعتقد مفهوم مفي داعي اشرحه local screenW, screenH = guiGetScreenSize() function content() dxDrawRectangle((screenW - 356) / 2, (screenH - 447) / 2, 356, 447, tocolor(0, 0, 0, 150), false) -- 447 + 356 الارقام الاصليه حقت المكان الي تبيه dxDrawText("Test", (screenW - 150) / 2, (screenH - 450) / 2, 150, 450, tocolor(255, 255, 255, 255), 1.00, "bankgothic", "left", "top", false, false, false, false, false) end 1 Share this post Link to post
HassoN 67 Posted August 13 On 18/07/2019 at 21:14, HassoN said: انا عن نفسي استعمل الطريقة الاتية local x, y = guiGetScreenSize ( ) local sx, sy = 1600, 900 -- مقاسات شاشتك -- مثال dxDrawText("TEST", 100, 200, 300, 400) -- الكود ذا على شاشتي فقط dxDrawText("TEST", x * (100/sx), y * (200/sy), x * (300/sx), y * (400/sy)) -- لجميع الشاشات وصلت الفكرة؟ 1 Share this post Link to post
xFabel 16 Posted August 13 3 hours ago, HassoN said: On 18/07/2019 at 20:14, HassoN said: انا عن نفسي استعمل الطريقة الاتية local x, y = guiGetScreenSize ( ) local sx, sy = 1600, 900 -- مقاسات شاشتك -- مثال dxDrawText("TEST", 100, 200, 300, 400) -- الكود ذا على شاشتي فقط dxDrawText("TEST", x * (100/sx), y * (200/sy), x * (300/sx), y * (400/sy)) -- لجميع الشاشات وصلت الفكرة؟ 8 hours ago, Bassam*Syria said: السلام عليكم ذا مثال اعتقد مفهوم مفي داعي اشرحه local screenW, screenH = guiGetScreenSize() function content() dxDrawRectangle((screenW - 356) / 2, (screenH - 447) / 2, 356, 447, tocolor(0, 0, 0, 150), false) -- 447 + 356 الارقام الاصليه حقت المكان الي تبيه dxDrawText("Test", (screenW - 150) / 2, (screenH - 450) / 2, 150, 450, tocolor(255, 255, 255, 255), 1.00, "bankgothic", "left", "top", false, false, false, false, false) end مشكورين ❤️ 1 Share this post Link to post