fix: improve bevel

Fix #23
This commit is contained in:
Kazhnuz 2020-08-04 19:53:11 +02:00
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

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

View file

@ -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

View file

@ -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

View file

@ -31,8 +31,13 @@ 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
function StatusBar:drawStatusArea(x, y)
self.assets.images["statusbar"]:draw(x, y)
local hpmax = self.stats.hpmax
local ppmax = self.stats.ppmax
@ -41,22 +46,21 @@ function StatusBar:draw(x, y)
local bar2 = math.floor((self.pp/self.stats.ppmax)*58)
love.graphics.setColor(248/255, 160/255, 0, 1)
gui.drawBar(x+29, y+5, bar1, 7)
gui.drawBar(x+10, y+11, bar1, 7)
love.graphics.setColor(0, 248/255, 248/255, 1)
gui.drawBar(x+17, y+17, bar2, 7)
gui.drawBar(x+22, y+23, bar2, 7)
utils.graphics.resetColor()
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.print(math.floor(self.hp) .. "/" .. hpmax, x+16, y+11)
love.graphics.print(math.floor(self.pp) .. "/" .. ppmax, x+32, y+23)
local lvl = self.abstract.level
if lvl < 100 then
lvl = "0" .. lvl
end
love.graphics.print(lvl, x+73, y-5)
love.graphics.print(lvl, x+42, y+1)
end
return StatusBar

View file

@ -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

View file

@ -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},