58 lines
1.7 KiB
Lua
58 lines
1.7 KiB
Lua
local BattleHUD = Object:extend()
|
|
|
|
local gui = require "game.modules.gui"
|
|
|
|
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)
|
|
self.hud1 = gui.newBorder(424, 30, 8)
|
|
|
|
self.hud2 = gui.newBorder(424, 20, 8)
|
|
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()
|
|
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)
|
|
--love.graphics.draw(self.hud2, 0, 200)
|
|
end
|
|
|
|
return BattleHUD
|