pixel-editor/js/_variables.js

45 lines
1.2 KiB
JavaScript
Raw Normal View History

2019-03-27 02:20:54 +03:00
//init variables
2020-09-16 14:08:44 +03:00
var canvasSize;
2020-09-16 14:52:55 +03:00
var zoom = 7;
2019-03-27 02:20:54 +03:00
var dragging = false;
var lastMouseClickPos = [0,0];
2019-03-27 02:20:54 +03:00
var dialogueOpen = false;
var documentCreated = false;
2020-07-21 00:33:17 +03:00
var pixelEditorMode;
2019-03-27 02:20:54 +03:00
//common elements
var brushPreview = document.getElementById("brush-preview");
var eyedropperPreview = document.getElementById("eyedropper-preview");
var canvasView = document.getElementById("canvas-view");
var colors = document.getElementsByClassName("color-button");
var colorsMenu = document.getElementById("colors-menu");
var popUpContainer = document.getElementById("pop-up-container");
2019-03-27 02:20:54 +03:00
// main canvas
2020-04-04 10:41:56 +03:00
var canvas = document.getElementById('pixel-canvas');
var currentGlobalColor;
2019-03-27 02:20:54 +03:00
// Layers
var layers = [];
// Currently selected layer
var currentLayer;
// VFX layer used to draw previews of the selection and things like that
var VFXLayer;
// VFX canvas
2020-04-04 10:41:56 +03:00
var VFXCanvas = document.getElementById('vfx-canvas');
// TMP layer
var TMPLayer;
// TMP canvas
2020-04-04 10:41:56 +03:00
var TMPCanvas = document.getElementById('tmp-canvas');
2020-09-25 10:25:27 +03:00
// Pixel grid layer
var pixelGrid;
// Pixel grid canvas
var pixelGridCanvas;
// Index of the first layer the user can use in the layers array
var firstUserLayerIndex = 2;
// Number of layers that are only used by the editor
var nAppLayers = 3;