Skip to content

Commit

Permalink
fix death overlay layout calculation
Browse files Browse the repository at this point in the history
  • Loading branch information
Bauumm committed Oct 1, 2023
1 parent b849b82 commit 3817a30
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion ui/screens/game.lua
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ local function retry()
end

local death_overlay = get_death_overlay(back_to_menu, retry)
local last_width, last_height

game_handler.onupdate = function()
local score = game_handler.get_score()
Expand All @@ -58,7 +59,12 @@ game_handler.onupdate = function()
timer.element.raw_text = score_str
timer.element.changed = true
timer:mutated()
death_overlay:calculate_layout(love.graphics.getWidth(), love.graphics.getHeight())
local width, height = love.graphics.getDimensions()
if last_width ~= width or last_height ~= height then
last_width = width
last_height = height
death_overlay:calculate_layout(width, height)
end
-- show death screen when dead
if game_handler.is_dead() then
if game_handler.is_replaying() then
Expand Down

0 comments on commit 3817a30

Please sign in to comment.