From b163cca8aee4ee2c7261e6c0318f9ce2b9cf3772 Mon Sep 17 00:00:00 2001 From: Kazhnuz Date: Mon, 4 Feb 2019 09:17:47 +0100 Subject: [PATCH] scenes/boost: improve HUD --- .../subgame/sonic-boost/controller/hud.lua | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/sonic-boost.love/scenes/subgame/sonic-boost/controller/hud.lua b/sonic-boost.love/scenes/subgame/sonic-boost/controller/hud.lua index ccbaeb6..ea19903 100644 --- a/sonic-boost.love/scenes/subgame/sonic-boost/controller/hud.lua +++ b/sonic-boost.love/scenes/subgame/sonic-boost/controller/hud.lua @@ -17,8 +17,8 @@ function BattleHUD:loadAssets() self.progressbarImage = love.graphics.newImage("assets/gui/hud/progressbar.png") self.barBack = love.graphics.newQuad(0, 0, 211, 12, 211, 24) self.barFore = love.graphics.newQuad(0, 12, 211, 12, 211, 24) - self.hud1 = gui.newBorder(424, 20, 8) - self.hud2 = gui.newBorder(424, 40, 8) + self.hud1 = gui.newBorder(424, 20, 14) + self.hud2 = gui.newBorder(424, 40, 12) self.ring = love.graphics.newImage("assets/gui/hud/ring.png") @@ -59,8 +59,12 @@ function BattleHUD:draw() end function BattleHUD:drawFrame() - love.graphics.draw(self.hud1, 0, 0) - love.graphics.draw(self.hud2, 0, 200) + love.graphics.setColor(0.256, 0.632, 0.852, 1) + love.graphics.rectangle("fill", 0, 0, 424, 20) + love.graphics.rectangle("fill", 0, 200, 424, 20) + utils.graphics.resetColor() + love.graphics.draw(self.hud1, 0, 0, 0, 1, -1, 0, 20) + love.graphics.draw(self.hud2, 0, 200, 0, -1, 1, 424, 0) end function BattleHUD:drawTop(x, y) @@ -92,7 +96,7 @@ function BattleHUD:drawTop(x, y) end function BattleHUD:drawBottom(x, y) - local progressx, progressy = x + 5, y + 4 + local progressx, progressy = x + 204, y + 4 love.graphics.draw(self.progressbarImage, self.barBack, progressx, progressy) local width = math.floor((self.target.x / self.controller.world.width) * (211 - 16)) width = math.max(0, width) @@ -107,7 +111,7 @@ function BattleHUD:drawBottom(x, y) love.graphics.printf(turn1 .. "/" .. turn2, progressx, progressy + 12 + 2, 210, "right") end - local timex, timey = x + 228, y + 1 + local timex, timey = x + 5, y + 2 love.graphics.draw(self.time, timex, timey) local timestring = self:getTimeString(self.controller.mission.timer)