2021-08-22 16:45:43 +02:00
|
|
|
local Parent = require "birb.modules.gui.elements.drawable"
|
|
|
|
local AssetElement = Parent:extend()
|
|
|
|
|
2021-08-31 10:56:43 +02:00
|
|
|
function AssetElement:new(name, assetType, assetName, x, y,r,sx,sy,ox,oy, opacity)
|
2021-08-31 23:47:01 +02:00
|
|
|
self:initWrapper()
|
|
|
|
local asset = self.assets[assetType][assetName]
|
2021-08-22 16:45:43 +02:00
|
|
|
assert(asset ~= nil, assetName .. ' (' .. assetType .. ") doesn't exist")
|
|
|
|
|
2021-08-31 10:56:43 +02:00
|
|
|
AssetElement.super.new(self, name, asset, x, y,r,sx,sy,ox,oy, opacity)
|
2021-08-22 16:45:43 +02:00
|
|
|
end
|
|
|
|
|
|
|
|
function AssetElement:draw()
|
|
|
|
self.drawable:draw(self.x,self.y,self.r,self.sx,self.sy,self.ox,self.oy)
|
|
|
|
end
|
|
|
|
|
|
|
|
return AssetElement
|