• Working Out Screen Ratio
    2 replies, posted
Hello there, So I am currently working on a "landing page" for my server, the issue is that people have different screen sizes and I don't want it to be stretched. Most people (to my knowledge) will use a repeating texture to deal with this as there are no chances of this being stretched. The only thing I can come up with is not efficient what so ever, which will basicly go though LOADS of numbers till it gets a ratio which the image supports. Is there a way I can maybe do a "IsFactor()" or "IsRatio". If you can offer any advice or help, please respond. This is an example of a repeating pattern. [IMG]https://trello-attachments.s3.amazonaws.com/58f8d24f750e969da2a18c3f/594525292bf024edec6d6f6e/6f508e744a18ee693df5547c226de316/newmenupossibly.PNG[/IMG] Edit: The Ratio must be in its simplest form
Ratio is Width/Height, so what about if you compare if it's 16/9 or 4/3
I was being stupid. Here is the Code though for other people who are having trouble [CODE] function GetScreenRatio() local h, w = ScrH(),ScrW() if (h * (4 / 3)) == w then return 1 elseif h * (16 / 9) == w then return 2 elseif h * (16 / 10) == w then return 3 else return false end end [/CODE] This works, I am returning numbers simply to get the position of the material in a table. Thanks for the help though
Sorry, you need to Log In to post a reply to this thread.