Krons Posted April 22, 2018 Share Posted April 22, 2018 Hello, I made a script in dx that is something like a square, the problem is that i made it on my resolution(1280x1024) where looks fine, but on other resolution will not be a square anymore. What I want is the dx to look like a square on all resolutions. local x, y = guiGetScreenSize() dxDrawImage(x * 0.2891, y * 0.2891, x * 0.4227, y * 0.4229, ":electric/circuitBoard.png", 0, 0, 0, tocolor(255, 255, 255, 255), false) This is how it looks for my resolution: and this is how it looks on other resolution: Link to comment
Dimos7 Posted April 22, 2018 Share Posted April 22, 2018 (edited) local sw, sh = guiGetScreenSize() local x, y = sw/1280, sh/1024 dxDrawImage(x * 0.2891, y * 0.2891, x * 0.4227, y * 0.4229, ":electric/circuitBoard.png", 0, 0, 0, tocolor(255, 255, 255, 255), false) Edited April 22, 2018 by Dimos7 Link to comment
LilDawage Posted April 22, 2018 Share Posted April 22, 2018 local x, y = guiGetScreenSize() dxDrawImage (x-y)/2 , 512, 512, ":electric/circuitBoard.png", 0, 0, 0, tocolor(255, 255, 255, 255), false) Link to comment
LilDawage Posted April 22, 2018 Share Posted April 22, 2018 (edited) local x, y = guiGetScreenSize() dxDrawImage x/2 , y/2 , 0.512, 0.512, ":electric/circuitBoard.png", 0, 0, 0, tocolor(255, 255, 255, 255), false) Edited April 22, 2018 by LilDawage Link to comment
Krons Posted April 22, 2018 Author Share Posted April 22, 2018 @LilDawage not working man. Link to comment
Krons Posted April 22, 2018 Author Share Posted April 22, 2018 I think I should try to use only one rezolution like width everywhere even on height. Link to comment
Krons Posted April 23, 2018 Author Share Posted April 23, 2018 @Dimos7 I tried that before/after you told me, ty for help but it's not working like that, anyway I think I fixed it. 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