2019-03-10 13:11:26 +01:00
|
|
|
local BattleHUD = Object:extend()
|
|
|
|
|
2019-03-10 13:56:49 +01:00
|
|
|
local gui = require "game.modules.gui"
|
|
|
|
|
2019-03-10 13:11:26 +01:00
|
|
|
function BattleHUD:new(controller)
|
|
|
|
self.controller = controller
|
|
|
|
|
|
|
|
self:loadAssets()
|
|
|
|
end
|
|
|
|
|
|
|
|
function BattleHUD:loadAssets()
|
|
|
|
self.progressbarImage = love.graphics.newImage("assets/gui/progressbar.png")
|
|
|
|
self.barBack = love.graphics.newQuad(0, 0, 211, 12, 211, 24)
|
|
|
|
self.barFore = love.graphics.newQuad(0, 12, 211, 12, 211, 24)
|
2019-03-10 13:56:49 +01:00
|
|
|
self.hud1 = gui.newBorder(424, 30, 8)
|
|
|
|
|
|
|
|
self.hud2 = gui.newBorder(424, 20, 8)
|
2019-03-10 13:11:26 +01:00
|
|
|
self.hud7 = love.graphics.newImage("assets/gui/status_bar.png")
|
|
|
|
|
|
|
|
self.ring = love.graphics.newImage("assets/gui/ring.png")
|
|
|
|
|
|
|
|
self.font = love.graphics.newImageFont("assets/gui/hudnumbers.png", " 0123456789:/", 1)
|
|
|
|
self.font2 = love.graphics.newImageFont("assets/gui/hudsmallnumbers.png", " 0123456789", 0)
|
|
|
|
|
|
|
|
self.time = love.graphics.newImage("assets/gui/hudtime.png")
|
|
|
|
self.score = love.graphics.newImage("assets/gui/hudscore.png")
|
|
|
|
self.bonus = love.graphics.newImage("assets/gui/hudbonus.png")
|
|
|
|
|
|
|
|
self.controller.assets:addTileset("lifeicon", "assets/sprites/characters/charicons")
|
|
|
|
end
|
|
|
|
|
|
|
|
function BattleHUD:destroy( )
|
|
|
|
self.progressbarImage:release( )
|
|
|
|
self.barBack:release( )
|
|
|
|
self.barFore:release( )
|
|
|
|
self.hud1:release( )
|
|
|
|
self.hud2:release( )
|
|
|
|
end
|
|
|
|
|
|
|
|
function BattleHUD:update(dt)
|
|
|
|
|
|
|
|
end
|
|
|
|
|
|
|
|
function BattleHUD:draw()
|
|
|
|
love.graphics.setFont( self.font )
|
|
|
|
self:drawFrame()
|
|
|
|
--self.controller:resetFont( )
|
|
|
|
end
|
|
|
|
|
|
|
|
function BattleHUD:drawFrame()
|
2019-03-31 10:15:27 +02:00
|
|
|
love.graphics.draw(self.hud1, 424, 20, 0, -1, -1)
|
|
|
|
love.graphics.draw(self.hud7, -8, 215)
|
|
|
|
love.graphics.draw(self.hud7, -8 + 128 + 24, 215)
|
|
|
|
love.graphics.draw(self.hud7, -8 + 256 + 48, 215)
|
2019-03-10 13:11:26 +01:00
|
|
|
--love.graphics.draw(self.hud2, 0, 200)
|
|
|
|
end
|
|
|
|
|
|
|
|
return BattleHUD
|