I'm facing a small problem with the love.graphics.getDimensions function on Android, I wrote myself a small script to resize the game according to the resolution which roughly looks like this:
Code: Select all
local lg = love.graphics
Display = {
size = {
w = WIN_W, -- Where WIN_* is the original game size
h = WIN_H
},
scale = {
x = 1,
y = 1
}
}
function Display:render(drawable, ...)
lg.push(); lg.scale(self.scale.x, self.scale.y)
drawable(...); lg.pop()
end
function Display:resize()
local size, scale = self.size, self.scale
size.w, size.h = lg.getDimensions()
scale.x = size.w / WIN_W
scale.y = size.h / WIN_H
end
I tried several hacks but without success, if anyone has a solution to this problem that would be great!