Advertisement
HugoBDesigner

Calculate resolution proportions

Jan 27th, 2015
227
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.24 KB | None | 0 0
  1. function love.load()
  2.     WW, WH = 1360, 768
  3.     mw, mh = 1360, 768
  4.    
  5.     for i = 1, math.max(WW, WH) do
  6.         local nx, ny = WW/i, WH/i
  7.         if math.mod(nx, 1) == 0 and math.mod(ny, 1) == 0 then
  8.             mw, mh = nx, ny
  9.         end
  10.     end
  11.    
  12.     error(mw .. ":" .. mh)
  13. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement