MAB Posted July 18, 2015 Posted July 18, 2015 How to make images , lines , rectangles fit all screen resolutions? You can find me here.
GTX Posted July 18, 2015 Posted July 18, 2015 https://wiki.multitheftauto.com/wiki/Gu ... esolutions Do you require a paid scripter? Contact me! (Unavailable) Currently I am experienced in Lua, PHP, HTML, CSS, SQL and JS. Developer and owner of https://projectbea.st - Project Beast
MAB Posted July 18, 2015 Author Posted July 18, 2015 this work with images and restangles You can find me here.
GTX Posted July 18, 2015 Posted July 18, 2015 Yes, with everything. Do you require a paid scripter? Contact me! (Unavailable) Currently I am experienced in Lua, PHP, HTML, CSS, SQL and JS. Developer and owner of https://projectbea.st - Project Beast
Dealman Posted July 19, 2015 Posted July 19, 2015 Of course, it's very simple math - you're using relative values instead of absolute. Relative values range from 0 to 1 and are floating point values, rather than integers like the absolute values are. For example, using absolute values you'd do it like this; dxDrawRectangle(860, 440, 200, 200) -- Creates a Rectangle 200x200 pixels wide, centered for 1920x1080. This will only work for 1920x1080, if you use a smaller resolution it will look as if it's too big. If you use a bigger resolution, it would be too small. To make it relative, you divide the absolute value with the source resolution(In this case it was designed on a 1920x1080 resolution). Then you multiply this by the current screen resolution. local screenWidth, screenHeight = guiGetScreenSize() dxDrawRectangle((860/1920)*screenWidth, (440/1080)*screenHeight, (200/1920)*screenWidth, (200/1080)*screenHeight) -- Creates a Rectangle 200x200 pixels wide, centered for all resolutions. -- 860/1920 = 0.4479166666666667 -- 0.4479166666666667 * 1920 = 860 If I help you in a thread and you need further assistance, please don't PM me - use the thread you created instead. This way everyone on the forum can take advantage of it.
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