TheSmart Posted September 22, 2015 Share Posted September 22, 2015 Hello guys! today i'm making dx Help panel but it have problem that is when i put x* and y* in Code that (rectangle & text) show in other position but when i remove x* and y* its back to his position i use guiGetScreenSize to fix it all resolution local sx,sy = guiGetScreenSize () local x,y = (sx/1024),(sy/768) That code function LT() dxDrawLine(x*74 - 1, y*269 - 1, x*74 - 1, y*993, tocolor(255, 9, 9, 255), 1, false) dxDrawLine(x*325, y*269 - 1, x*74 - 1, y*269 - 1, tocolor(255, 9, 9, 255), 1, false) dxDrawLine(x*74 - 1, y*993, x*325, y*993, tocolor(255, 9, 9, 255), 1, false) dxDrawLine(x*325, y*993, x*325, y*269 - 1, tocolor(255, 9, 9, 255), 1, false) dxDrawRectangle(x*74, y*269, x*251, y*724, tocolor(0, 0, 0, 176), false) -------------------------------------- dxDrawRectangle(x*76, y*287, x*248, y*40, tocolor(255, 0, 0, 175), false) dxDrawText("Introduction", x*75, y*287, x*324, y*326, tocolor(0, 0, 0, 255), 1.10, "bankgothic", "left", "top", false, false, false, false, false) dxDrawRectangle(x*76, y*367, x*248, y*40, tocolor(255, 0, 0, 175), false) dxDrawText("NGG Features", x*75, y*367, x*324, y*406, tocolor(0, 0, 0, 255), 1.09, "bankgothic", "left", "top", false, false, false, false, false) dxDrawRectangle(x*75, y*451, x*248, y*40, tocolor(255, 0, 0, 175), false) dxDrawText("NGG Forum", x*74, y*452, x*323, y*491, tocolor(0, 0, 0, 255), 1.09, "bankgothic", "left", "top", false, false, false, false, false) end That happen http://i.imgur.com/ftbpFGd.png that code when i remove it function LT() dxDrawLine(74 - 1, 269 - 1, 74 - 1, 993, tocolor(255, 9, 9, 255), 1, false) dxDrawLine(325, 269 - 1, 74 - 1, 269 - 1, tocolor(255, 9, 9, 255), 1, false) dxDrawLine(74 - 1, 993, 325, 993, tocolor(255, 9, 9, 255), 1, false) dxDrawLine(325, 993, 325, 269 - 1, tocolor(255, 9, 9, 255), 1, false) dxDrawRectangle(74, 269, 251, 724, tocolor(0, 0, 0, 176), false) -------------------------------------- dxDrawRectangle(76, 287, 248, 40, tocolor(255, 0, 0, 175), false) dxDrawText("Introduction", 75, 287, 324, 326, tocolor(0, 0, 0, 255), 1.10, "bankgothic", "left", "top", false, false, false, false, false) dxDrawRectangle(76, 367, 248, 40, tocolor(255, 0, 0, 175), false) dxDrawText("NGG Features", 75, 367, 324, 406, tocolor(0, 0, 0, 255), 1.09, "bankgothic", "left", "top", false, false, false, false, false) dxDrawRectangle(75, 451, 248, 40, tocolor(255, 0, 0, 175), false) dxDrawText("NGG Forum", 74, 452, 323, 491, tocolor(0, 0, 0, 255), 1.09, "bankgothic", "left", "top", false, false, false, false, false) end then its back to his position http://i.imgur.com/tpO3edx.png what wrong doing i'm? Hope you understand my BAD English Link to comment
KariiiM Posted September 22, 2015 Share Posted September 22, 2015 copy my code it should works correctly with your resolution and why you did to some numbers -1 since they're numbers able to edit not like a string, anyway i calculed them to keep your code simply and clear local sx,sy = guiGetScreenSize () function LT() dxDrawLine((73/1024)*sx, (268/768)*sy, (73/1024)*sx, (993/768)*sy, tocolor(255, 9, 9, 255), 1, false) dxDrawLine((325/1024)*sx, (268/768)*sy, (73/1024)*sx, (268/768)*sy, tocolor(255, 9, 9, 255), 1, false) dxDrawLine((73/1024)*sx, (993/768)*sy, (325/1024)*sx, (993/768)*sy, tocolor(255, 9, 9, 255), 1, false) dxDrawLine((325/1024)*sx, (993/768)*sy, (325/1024)*sx, (268/768)*sy, tocolor(255, 9, 9, 255), 1, false) dxDrawRectangle((74/1024)*sx, (269/768)*sy, (251/1024)*sx, (724/768)*sy, tocolor(0, 0, 0, 176), false) -------------------------------------- dxDrawRectangle((76/1024)*sx, (287/768)*sy, (248/1024)*sx, (40/768)*sy, tocolor(255, 0, 0, 175), false) dxDrawText("Introduction",(75/1024)*sx, (287/768)*sy, (324/1024)*sx, (326/768)*sy, tocolor(0, 0, 0, 255), 1.10, "bankgothic", "left", "top", false, false, false, false, false) dxDrawRectangle((76/1024)*sx, (367/768)*sy, (248/1024)*sx, (40/768)*sy, tocolor(255, 0, 0, 175), false) dxDrawText("NGG Features", (75/1024)*sx, (367/768)*sy, (324/1024)*sx, (406/768)*sy, tocolor(0, 0, 0, 255), 1.09, "bankgothic", "left", "top", false, false, false, false, false) dxDrawRectangle((75/1024)*sx, (451/768)*sy, (248/1024)*sx, (40/768)*sy, tocolor(255, 0, 0, 175), false) dxDrawText("NGG Forum", (74/1024)*sx, (452/768)*sy, (323/1024)*sx, (491/768)*sy, tocolor(0, 0, 0, 255), 1.09, "bankgothic", "left", "top", false, false, false, false, false) end Link to comment
TheSmart Posted September 22, 2015 Author Share Posted September 22, 2015 copy my code it should works correctly with your resolution and why you did to some numbers -1 since they're numbers able to edit not like a string, anyway i calculed them to keep your code simply and clear local sx,sy = guiGetScreenSize () function LT() dxDrawLine((73/1024)*sx, (268/768)*sy, (73/1024)*sx, (993/768)*sy, tocolor(255, 9, 9, 255), 1, false) dxDrawLine((325/1024)*sx, (268/768)*sy, (73/1024)*sx, (268/768)*sy, tocolor(255, 9, 9, 255), 1, false) dxDrawLine((73/1024)*sx, (993/768)*sy, (325/1024)*sx, (993/768)*sy, tocolor(255, 9, 9, 255), 1, false) dxDrawLine((325/1024)*sx, (993/768)*sy, (325/1024)*sx, (268/768)*sy, tocolor(255, 9, 9, 255), 1, false) dxDrawRectangle((74/1024)*sx, (269/768)*sy, (251/1024)*sx, (724/768)*sy, tocolor(0, 0, 0, 176), false) -------------------------------------- dxDrawRectangle((76/1024)*sx, (287/768)*sy, (248/1024)*sx, (40/768)*sy, tocolor(255, 0, 0, 175), false) dxDrawText("Introduction",(75/1024)*sx, (287/768)*sy, (324/1024)*sx, (326/768)*sy, tocolor(0, 0, 0, 255), 1.10, "bankgothic", "left", "top", false, false, false, false, false) dxDrawRectangle((76/1024)*sx, (367/768)*sy, (248/1024)*sx, (40/768)*sy, tocolor(255, 0, 0, 175), false) dxDrawText("NGG Features", (75/1024)*sx, (367/768)*sy, (324/1024)*sx, (406/768)*sy, tocolor(0, 0, 0, 255), 1.09, "bankgothic", "left", "top", false, false, false, false, false) dxDrawRectangle((75/1024)*sx, (451/768)*sy, (248/1024)*sx, (40/768)*sy, tocolor(255, 0, 0, 175), false) dxDrawText("NGG Forum", (74/1024)*sx, (452/768)*sy, (323/1024)*sx, (491/768)*sy, tocolor(0, 0, 0, 255), 1.09, "bankgothic", "left", "top", false, false, false, false, false) end Nope, nothing Changed :\ Link to comment
Moderators Citizen Posted September 22, 2015 Moderators Share Posted September 22, 2015 Where you still in 1024x768 resolution when you built that part of the panel ? Because a dx interface built in 1024x768 have to look the same when calculating the relative positions and sizes in that same resolution (like the rest of the panel). Link to comment
TheSmart Posted September 23, 2015 Author Share Posted September 23, 2015 ahh Thank you @Citizen 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