Right now I'm trying to create a Texture on one part of the screen and draw on it. (my screen is set to 640 x 512)
const Texture = require('pixelbox/Texture');
let texture = new Texture(512, 512);
texture.setTilesheet(tilesheet);
texture.setPalette(palette);
texture.paper(2);
texture.cls();
texture.sprite(35, 50, 50);
//▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
// Update is called once per frame
exports.update = function () {
draw(texture);
};
This code gives me this error on the developer console:
If I change the line the sets the pallet to this -> texture.setPalette("palette"); the code works but it does not draw the paper color, the background becomes black.
If I use the palette outside the texture, the paper color works fine.