parent
5d34f55b23
commit
d6b62a41e2
8 changed files with 42 additions and 26 deletions
Binary file not shown.
Before Width: | Height: | Size: 224 B After Width: | Height: | Size: 3.2 KiB |
BIN
sonic-radiance.love/assets/gui/egghead.png
Normal file
BIN
sonic-radiance.love/assets/gui/egghead.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 664 B |
Binary file not shown.
Before Width: | Height: | Size: 6 KiB After Width: | Height: | Size: 6.7 KiB |
|
@ -9,14 +9,24 @@ function Emblem:new(abstract, scene)
|
|||
end
|
||||
|
||||
function Emblem:draw(x, y)
|
||||
local emblem1 = "e_" .. self.abstract.data.class
|
||||
local emblem2 = "m_" .. self.abstract.data.class
|
||||
self:drawBackground(x, y)
|
||||
self:drawForeground(x, y)
|
||||
end
|
||||
|
||||
self.assets.images[emblem1]:draw(x, y)
|
||||
function Emblem:drawForeground(x, y)
|
||||
local emblem2 = "m_" .. self.abstract.data.class
|
||||
core.screen:setScissor(x, y-16, 32, 40)
|
||||
self.assets.sprites[self.charid]:drawAnimation(x+14, y+14)
|
||||
core.screen:resetScissor( )
|
||||
self.assets.images[emblem2]:draw(x, y)
|
||||
end
|
||||
|
||||
function Emblem:drawBackground(x, y)
|
||||
local emblem1 = "e_" .. self.abstract.data.class
|
||||
|
||||
self.assets.images[emblem1]:draw(x, y)
|
||||
|
||||
end
|
||||
|
||||
|
||||
return Emblem
|
||||
|
|
|
@ -20,9 +20,10 @@ end
|
|||
function SimpleHPBar:draw(x, y)
|
||||
love.graphics.setColor(0, 0, 0, 1)
|
||||
gui.drawBar(x, y, 26, 4)
|
||||
love.graphics.rectangle("fill", x, y, 24, 4)
|
||||
love.graphics.setColor(248/255, 160/255, 0, 1)
|
||||
local bar = math.floor(24 * (self.hp / self.baseHP))
|
||||
gui.drawBar(x, y + 1, bar, 2)
|
||||
local bar = math.max(0, math.floor(22 * (self.hp / self.baseHP)))
|
||||
love.graphics.rectangle("fill", x + 1, y + 1, math.floor(bar), 2)
|
||||
love.graphics.setColor(1, 1, 1, 1)
|
||||
end
|
||||
|
||||
|
|
|
@ -31,32 +31,36 @@ function StatusBar:updatePP()
|
|||
end
|
||||
|
||||
function StatusBar:draw(x, y)
|
||||
self.emblem:draw(x, y)
|
||||
self.assets.images["statusbar"]:draw(x+12, y-6)
|
||||
self.emblem:drawBackground(x, y)
|
||||
self:drawStatusArea(x+10, y-8)
|
||||
self.emblem:drawForeground(x, y)
|
||||
end
|
||||
|
||||
local hpmax = self.stats.hpmax
|
||||
local ppmax = self.stats.ppmax
|
||||
function StatusBar:drawStatusArea(x, y)
|
||||
self.assets.images["statusbar"]:draw(x, y)
|
||||
|
||||
local bar1 = math.floor((self.hp/self.stats.hpmax)*58)
|
||||
local bar2 = math.floor((self.pp/self.stats.ppmax)*58)
|
||||
local hpmax = self.stats.hpmax
|
||||
local ppmax = self.stats.ppmax
|
||||
|
||||
love.graphics.setColor(248/255, 160/255, 0, 1)
|
||||
gui.drawBar(x+29, y+5, bar1, 7)
|
||||
love.graphics.setColor(0, 248/255, 248/255, 1)
|
||||
gui.drawBar(x+17, y+17, bar2, 7)
|
||||
utils.graphics.resetColor()
|
||||
local bar1 = math.floor((self.hp/self.stats.hpmax)*58)
|
||||
local bar2 = math.floor((self.pp/self.stats.ppmax)*58)
|
||||
|
||||
self.assets.fonts["hudnbrs_small"]:set()
|
||||
love.graphics.print(math.floor(self.hp) .. "/" .. hpmax, x+34, y+5)
|
||||
love.graphics.print(math.floor(self.pp) .. "/" .. ppmax, x+28, y+17)
|
||||
love.graphics.setColor(248/255, 160/255, 0, 1)
|
||||
gui.drawBar(x+10, y+11, bar1, 7)
|
||||
love.graphics.setColor(0, 248/255, 248/255, 1)
|
||||
gui.drawBar(x+22, y+23, bar2, 7)
|
||||
utils.graphics.resetColor()
|
||||
|
||||
local lvl = self.abstract.level
|
||||
self.assets.fonts["hudnbrs_small"]:set()
|
||||
love.graphics.print(math.floor(self.hp) .. "/" .. hpmax, x+16, y+11)
|
||||
love.graphics.print(math.floor(self.pp) .. "/" .. ppmax, x+32, y+23)
|
||||
|
||||
if lvl < 100 then
|
||||
local lvl = self.abstract.level
|
||||
|
||||
if lvl < 100 then
|
||||
lvl = "0" .. lvl
|
||||
end
|
||||
|
||||
love.graphics.print(lvl, x+73, y-5)
|
||||
end
|
||||
love.graphics.print(lvl, x+42, y+1)
|
||||
end
|
||||
|
||||
return StatusBar
|
||||
|
|
|
@ -14,7 +14,7 @@ function Ennemy:draw()
|
|||
Ennemy.super.draw(self)
|
||||
local x, y = self.world.map:gridToPixel(self.x, self.y, true)
|
||||
|
||||
self.owner:drawHUD(x - 14, y - 38)
|
||||
self.owner:drawHUD(x - 12, y - 38)
|
||||
|
||||
if (self.isSelected) then
|
||||
local height = 32
|
||||
|
|
|
@ -25,7 +25,8 @@ return {
|
|||
{"m_power", "assets/gui/emblem_power_mask.png"},
|
||||
|
||||
{"hudturn", "assets/gui/strings/hudturn.png"},
|
||||
{"battlecompleted", "assets/gui/strings/battle_completed.png" }
|
||||
{"battlecompleted", "assets/gui/strings/battle_completed.png" },
|
||||
{"egghead", "assets/gui/egghead.png"}
|
||||
},
|
||||
["fonts"] = {
|
||||
{"small", "assets/gui/fonts/PixelOperator.ttf", 16},
|
||||
|
|
Loading…
Reference in a new issue