Connected events to rect selection

_rectSelect.js now knows when the user started and finished drawing a rect and is able to edit a preview.
This commit is contained in:
unsettledgames
2020-03-04 14:36:40 +01:00
parent cba4e5c87e
commit efaa8e3c34
7 changed files with 67 additions and 24 deletions

View File

@@ -1,13 +1,21 @@
function newPixel (width, height, palette) {
// Setting the current layer
currentLayer = new Canvas(width, height, canvas);
currentLayer.initialize();
// Adding the checkerboard behind it
checkerBoard = new Canvas(width, height, checkerBoardCanvas);
checkerBoard.initialize();
// Creating the vfx layer on top of everything
VFXLayer = new Canvas(width, height, VFXCanvas);
VFXLayer.initialize();
canvasSize = currentLayer.canvasSize;
// Adding the first layer and the checkerboard to the list of layers
layers.push(VFXLayer);
layers.push(currentLayer);
layers.push(checkerBoard);