Implemented visibility option

Fixed all the bugs in the add layer feature, now it's also possible to toggle the visibility of a layer. Next step: locking layers.
This commit is contained in:
unsettledgames
2020-06-18 23:24:37 +02:00
parent 6cf6f86a91
commit 750414d63a
2 changed files with 87 additions and 42 deletions

View File

@@ -1,18 +1,19 @@
function newPixel (width, height, palette) {
// Setting the current layer
layerList = document.getElementById("layers-menu");
layerListEntry = layerList.firstElementChild;
console.log("Layer entry: " + layerListEntry);
// Setting up the current layer
currentLayer = new Layer(width, height, canvas, layerListEntry);
currentLayer.initialize();
// Adding the checkerboard behind it
checkerBoard = new Layer(width, height, checkerBoardCanvas);
checkerBoard.initialize();
// Creating the vfx layer on top of everything
VFXLayer = new Layer(width, height, VFXCanvas);
VFXLayer.initialize();
// Tmp layer to draw previews on
TMPLayer = new Layer(width, height, TMPCanvas);
TMPLayer.initialize();
canvasSize = currentLayer.canvasSize;