This commit is contained in:
Igor Timofeev
2017-01-15 02:43:42 +03:00
parent 30e360eb8f
commit 45342e7d8f
6 changed files with 57 additions and 9 deletions

View File

@@ -2039,7 +2039,7 @@ function ecs.universalWindow(x, y, width, background, closeWindowAfter, ...)
local screenWidth, screenHeight = component.gpu.getResolution()
local paletteX, paletteY = math.floor(screenWidth / 2 - paletteWidth / 2), math.floor(screenHeight / 2 - paletteHeight / 2)
local oldPixels = ecs.rememberOldPixels(paletteX, paletteY, paletteX + paletteWidth - 1, paletteY + paletteHeight - 1)
local color = loadfile("lib/palette.lua")().draw("auto", "auto", objects[key][3])
local color = require("palette").draw("auto", "auto", objects[key][3])
ecs.drawOldPixels(oldPixels)
objects[key][3] = color or oldColor