solved the scale issues

This commit is contained in:
bizcochito 2022-01-20 13:53:32 +01:00
parent 151890b585
commit 2d8b8a23db
2 changed files with 9 additions and 5 deletions

View File

@ -23,13 +23,12 @@ function GameDraw()
-- hud -- hud
textScale = 0.5 textScale = 0.5
-- pause
if do_pause then PauseUI() end
-- debug -- debug
if debug then DebugUI() end if debug then DebugUI() end
if debug_collision then if debug_collision then
DebugColisions() DebugColisions()
DebugEntities() DebugEntities()
end end
-- pause
if do_pause then PauseUI() end
end end

View File

@ -1,14 +1,19 @@
function PauseUI() function PauseUI()
--Parameters -- Set scale to 1
love.graphics.scale(0.5,0.5)
-- Parameters
local pauseWidth = 640 local pauseWidth = 640
local pauseHeight = 480 local pauseHeight = 480
local pauseX = (game.width/2)-(pauseWidth/2) local pauseX = (game.width/2)-(pauseWidth/2)
local pauseY = (game.height/2)-(pauseHeight/2) local pauseY = (game.height/2)-(pauseHeight/2)
local mouse_x, mouse_y = love.mouse.getPosition() local mouse_x, mouse_y = love.mouse.getPosition()
--print(game.width .. " ".. game.height .. " ".. pauseWidth .. " ".. pauseHeight .. " " .. pauseX .. " " .. pauseY)
-- Base items -- Base items
love.graphics.setColor(0,0,0,0.3) love.graphics.setColor(0,0,0,0.3)
love.graphics.rectangle("fill", 0, 0, game.width, game.height) love.graphics.rectangle("fill", 0, 0, game.width, game.height)
love.graphics.setColor(1,1,1,1) love.graphics.setColor(1,1,1,1)
love.graphics.rectangle("fill", pauseX, pauseY, pauseWidth, pauseHeight) love.graphics.rectangle("fill", pauseX, pauseY, pauseWidth, pauseHeight)
-- Reset scale
love.graphics.scale(2,2)
end end