I've looked around on the forums using the search function, to no avail...
My question is, how do I find the middle of the screen after applying love.graphics.scale?
I would have thought that you can just apply the values that you've used in love.graphics.scale() to the screens X and Y positions in some way or other...
Example:
Code: Select all
function love.load()
screenHeight = love.graphics.getScreenHeight()
screenWidth = love.graphics.getScreenWidth()
scale = 0.3
-- something LIKE this:
middleScreenHeight = screenHeight/2 * scale
middleScreenWidth = screenWidth/2 * scale
end
function love.draw()
love.graphics.scale(scale, scale)
love.graphics.setColor(255, 0, 0, 255)
-- Draws the rectangle to the center of the screen
love.graphics.rectangle(middleScreenHeight, middleScreenWidth, 32, 32)
end