Skip to content

Instantly share code, notes, and snippets.

@remyroez
Last active March 3, 2018 15:40
Show Gist options
  • Save remyroez/49565b79fb5605e6cf51ed9402380a07 to your computer and use it in GitHub Desktop.
Save remyroez/49565b79fb5605e6cf51ed9402380a07 to your computer and use it in GitHub Desktop.
maid64 integral multiplication
local maid64 = require 'maid64'
function resize(width, height)
local w, h = love.graphics.getDimensions()
width = math.max(maid64.sizeX, math.floor((width or w) / maid64.sizeX) * maid64.sizeX)
height = math.max(maid64.sizeY, math.floor((height or h) / maid64.sizeY) * maid64.sizeY)
maid64.resize(width, height)
if maid64.overscan then
maid64.x = (w - (maid64.scaler * maid64.sizeX)) / 2
else
maid64.x = w / 2 - (maid64.scaler * (maid64.sizeX / 2))
end
maid64.y = h / 2 - (maid64.scaler * (maid64.sizeY / 2))
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment