Last active
March 3, 2018 15:40
-
-
Save remyroez/49565b79fb5605e6cf51ed9402380a07 to your computer and use it in GitHub Desktop.
maid64 integral multiplication
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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