JeViCo Posted February 7, 2018 Posted February 7, 2018 Hello everyone, what's wring in code below? local screenW, screenH = guiGetScreenSize() addEventHandler("onClientRender", root, function() dxDrawImage((screenW - 561) / 2, (screenH - 431) / 2, 561, 431, "images/back.png", 0, 0, 0, tocolor(255, 255, 255, 255), false) dxDrawImage((screenW - 517) / 2, (screenH - 465) / 2, 332, 86, "images/button.png", 0, 0, 0, tocolor(255, 255, 255, 255), false) dxDrawImage((screenW - 522) / 2, (screenH - 459) / 2, 96, 96, "images/pay.png", 0, 0, 0, tocolor(0, 0, 0, 255), false) dxDrawImage((screenW - 520) / 2, (screenH - 456) / 2, 96, 96, "images/pay.png", 0, 0, 0, tocolor(255, 255, 255, 255), false) dxDrawImage((screenW - 906) / 2, (screenH - 179) / 2, 48, 48, "images/deny.png", 0, 0, 0, tocolor(255, 255, 255, 255), false) dxDrawText("Контрольно-пропускной\nпункт", (screenW - 539 - 1) / 2, (screenH - 173 - 1) / 2, 827 - 1, 268 - 1, tocolor(0, 0, 0, 255), 2.50, "default", "center", "center", false, false, false, false, false) dxDrawText("Контрольно-пропускной\nпункт", (screenW - 539 + 1) / 2, (screenH - 173 - 1) / 2, 827 + 1, 268 - 1, tocolor(0, 0, 0, 255), 2.50, "default", "center", "center", false, false, false, false, false) dxDrawText("Контрольно-пропускной\nпункт", (screenW - 539 - 1) / 2, (screenH - 173 + 1) / 2, 827 - 1, 268 + 1, tocolor(0, 0, 0, 255), 2.50, "default", "center", "center", false, false, false, false, false) dxDrawText("Контрольно-пропускной\nпункт", (screenW - 539 + 1) / 2, (screenH - 173 + 1) / 2, 827 + 1, 268 + 1, tocolor(0, 0, 0, 255), 2.50, "default", "center", "center", false, false, false, false, false) dxDrawText("Контрольно-пропускной\nпункт", (screenW - 539) / 2, (screenH - 173) / 2, 827, 268, tocolor(255, 255, 255, 255), 2.50, "default", "center", "center", false, false, false, false, false) dxDrawText("Оплатить проезд", (screenW - 614) / 2, (screenH - 480) / 2, 814, 534, tocolor(0, 0, 0, 255), 2.30, "default", "center", "center", false, false, false, false, false) dxDrawText("Оплатить проезд", (screenW - 614) / 2, (screenH - 477) / 2, 814, 531, tocolor(255, 255, 255, 255), 2.30, "default", "center", "center", false, false, false, false, false) dxDrawImage((screenW - 517) / 2, (screenH - 338) / 2, 332, 86, "images/button.png", 0, 0, 0, tocolor(255, 255, 255, 255), false) dxDrawText("$", (screenW - 665) / 2, (screenH - 352) / 2, 691, 405, tocolor(0, 0, 0, 255), 4.00, "default", "center", "center", false, false, false, false, false) dxDrawText("$", (screenW - 663) / 2, (screenH - 348) / 2, 689, 401, tocolor(255, 254, 254, 255), 4.00, "default", "center", "center", false, false, false, false, false) end ) guieditor makes only first line correct. Everything below 1 line is incorrect (coordinates)
Skully Posted February 8, 2018 Posted February 8, 2018 Code looks fine, try adjusting your screen resolution or make the GUI relative instead of absolute.
JeViCo Posted February 8, 2018 Author Posted February 8, 2018 9 hours ago, Dimos7 said: What is your screen resolution? 1366x768 and everything stacks in top left corner. Their sizes are normal 5 hours ago, Skully said: Code looks fine, try adjusting your screen resolution or make the GUI relative instead of absolute. i'll try it
Dimos7 Posted February 8, 2018 Posted February 8, 2018 (edited) local sx, sy = guiGetScreenSize() local sw, sh = sx/1366, sy/768 addEventHandler("onClientRender", root, function() dxDrawImage((sx - 561) / 2, (sy - 431) / 2, sw*561, sh*431, "images/back.png", 0, 0, 0, tocolor(255, 255, 255, 255), false) dxDrawImage((sx - 517) / 2, (sy - 465) / 2, sw*332, sh*86, "images/button.png", 0, 0, 0, tocolor(255, 255, 255, 255), false) dxDrawImage((sx - 522) / 2, (sy - 459) / 2, sw*96, sh*96, "images/pay.png", 0, 0, 0, tocolor(0, 0, 0, 255), false) dxDrawImage((sx - 520) / 2, (sy - 456) / 2, sw*96, sh*96, "images/pay.png", 0, 0, 0, tocolor(255, 255, 255, 255), false) dxDrawImage((sx - 906) / 2, (sy - 179) / 2, sw*48, sh*48, "images/deny.png", 0, 0, 0, tocolor(255, 255, 255, 255), false) dxDrawText("Контрольно-пропускной\nпункт", (sx - 539 - 1) / 2, (sy - 173 - 1) / 2, sw*827 - 1, sh*268 - 1, tocolor(0, 0, 0, 255), 2.50, "default", "center", "center", false, false, false, false, false) dxDrawText("Контрольно-пропускной\nпункт", (sx - 539 + 1) / 2, (sy - 173 - 1) / 2, sw*827 + 1, sh*268 - 1, tocolor(0, 0, 0, 255), 2.50, "default", "center", "center", false, false, false, false, false) dxDrawText("Контрольно-пропускной\nпункт", (sx - 539 - 1) / 2, (sy - 173 + 1) / 2, sw*827 - 1, sh*268 + 1, tocolor(0, 0, 0, 255), 2.50, "default", "center", "center", false, false, false, false, false) dxDrawText("Контрольно-пропускной\nпункт", (sx - 539 + 1) / 2, (sy - 173 + 1) / 2, sw*827 + 1, sh*268 + 1, tocolor(0, 0, 0, 255), 2.50, "default", "center", "center", false, false, false, false, false) dxDrawText("Контрольно-пропускной\nпункт", (sx - 539) / 2, (sy - 173) / 2, sw*827, sh*268, tocolor(255, 255, 255, 255), 2.50, "default", "center", "center", false, false, false, false, false) dxDrawText("Оплатить проезд", (sx - 614) / 2, (sy - 480) / 2, sw*814, sh*534, tocolor(0, 0, 0, 255), 2.30, "default", "center", "center", false, false, false, false, false) dxDrawText("Оплатить проезд", (sx - 614) / 2, (sy - 477) / 2, sw*814, sh*531, tocolor(255, 255, 255, 255), 2.30, "default", "center", "center", false, false, false, false, false) dxDrawImage((sx - 517) / 2, (sy - 338) / 2, sw*332, sh*86, "images/button.png", 0, 0, 0, tocolor(255, 255, 255, 255), false) dxDrawText("$", (sx - 665) / 2, (sy - 352) / 2, sw*691, sh*405, tocolor(0, 0, 0, 255), 4.00, "default", "center", "center", false, false, false, false, false) dxDrawText("$", (sx - 663) / 2, (sy - 348) / 2, sw*689, sh*401, tocolor(255, 254, 254, 255), 4.00, "default", "center", "center", false, false, false, false, false) end ) try that i hope fit to all the resolution Edited February 8, 2018 by Dimos7
JeViCo Posted February 8, 2018 Author Posted February 8, 2018 (edited) It has a little bit different result but still keep stacking in one place( 10 hours ago, Skully said: Code looks fine, try adjusting your screen resolution or make the GUI relative instead of absolute. Thanks, everything on it's position. But now text doesn't fit in frames. How can i fix that? Edited February 8, 2018 by Juuve
Skully Posted February 8, 2018 Posted February 8, 2018 4 hours ago, Juuve said: It has a little bit different result but still keep stacking in one place( Thanks, everything on it's position. But now text doesn't fit in frames. How can i fix that? If you mean they don't fit the windows, you can try reducing the font size of the text.
JeViCo Posted February 8, 2018 Author Posted February 8, 2018 3 minutes ago, Skully said: If you mean they don't fit the windows, you can try reducing the font size of the text. It'll be smaller in 2+ times in higher resolutions(
Skully Posted February 8, 2018 Posted February 8, 2018 1 minute ago, Juuve said: It'll be smaller in 2+ times in higher resolutions( Why not make the windows larger than to fit the text?
JeViCo Posted February 8, 2018 Author Posted February 8, 2018 3 minutes ago, Skully said: Why not make the windows larger than to fit the text? you didn't understand me . I mean that text scale doesn't change with different resolutions and i don't know how to fix that. It is big on small resolutions and small on high resolutions
Dimos7 Posted February 8, 2018 Posted February 8, 2018 Try to change the scale your selfie and find a nice one
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