canvas overhaul

This commit is contained in:
kepler155c@gmail.com
2020-03-31 09:57:23 -06:00
parent 369070e19c
commit 5a874c1944
69 changed files with 1134 additions and 786 deletions

View File

@@ -5,17 +5,18 @@ UI.NftImage = class(UI.Window)
UI.NftImage.defaults = {
UIElement = 'NftImage',
}
function UI.NftImage:setParent()
if self.image then
function UI.NftImage:postInit()
if self.image and not (self.ey or self.height) then
self.height = self.image.height
end
if self.image and not self.width then
if self.image and not (self.ex or self.width) then
self.width = self.image.width
end
UI.Window.setParent(self)
end
function UI.NftImage:draw()
self:clear()
if self.image then
-- due to blittle, the background and foreground transparent
-- color is the same as the background color
@@ -25,8 +26,6 @@ function UI.NftImage:draw()
self:write(x, y, self.image.text[y][x], self.image.bg[y][x], self.image.fg[y][x] or bg)
end
end
else
self:clear()
end
end