sonic-radiance/sonic-radiance.love/game/modules/gui/emblem.lua

33 lines
718 B
Lua
Raw Normal View History

2020-08-03 09:34:23 +02:00
local Emblem = Object:extend()
function Emblem:new(abstract, scene)
self.assets = scene.assets
self.abstract = abstract
self.charid = self.abstract.simplename
self.stats = self.abstract:getStats()
end
function Emblem:draw(x, y)
2020-08-04 19:53:11 +02:00
self:drawBackground(x, y)
self:drawForeground(x, y)
end
2020-08-03 09:34:23 +02:00
2020-08-04 19:53:11 +02:00
function Emblem:drawForeground(x, y)
local emblem2 = "m_" .. self.abstract.data.class
2020-08-03 09:34:23 +02:00
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
2020-08-04 19:53:11 +02:00
function Emblem:drawBackground(x, y)
local emblem1 = "e_" .. self.abstract.data.class
self.assets.images[emblem1]:draw(x, y)
end
2020-08-03 09:34:23 +02:00
return Emblem