sonic-bluestreak/sonic-bluestreak.love/scenes/battlesystem/gui/victory/items.lua

23 lines
701 B
Lua
Raw Permalink Normal View History

2021-11-25 10:57:13 +01:00
local CanvasElement = require "birb.modules.gui.elements.canvas"
local ItemsElement = CanvasElement:extend()
local gui = require "game.modules.gui"
function ItemsElement:new(x, y, list)
self.background = gui.newTextBox("assets/gui/dialogbox.png", 128, 40+16)
local w, h = self.background:getDimensions()
ItemsElement.super.new(self, "items", x, y, w, h)
self.opacity = 0
self.list = list
end
function ItemsElement:drawTexture()
love.graphics.draw(self.background, 0, 0)
for index, value in ipairs(self.list) do
if (index <= 4) then
self.assets.fonts["small"]:draw(value, 8, 4 + (16*(index-1)), -1, "left")
end
end
end
return ItemsElement