mirror of
https://github.com/lospec/pixel-editor.git
synced 2023-08-10 21:12:51 +03:00
Started pixel grid
This commit is contained in:
@ -13,7 +13,7 @@ The next version is mostly focused on adding missing essential features and port
|
|||||||
Suggestions / Planned features:
|
Suggestions / Planned features:
|
||||||
|
|
||||||
- Line tool
|
- Line tool
|
||||||
- Resize sprite
|
- Tiled mode
|
||||||
- Load palette from LPE file
|
- Load palette from LPE file
|
||||||
- Move colours in (advanced) palette editor
|
- Move colours in (advanced) palette editor
|
||||||
- Symmetry options
|
- Symmetry options
|
||||||
@ -29,13 +29,7 @@ Suggestions / Planned features:
|
|||||||
- Stack colors when too many
|
- Stack colors when too many
|
||||||
- Fix popups
|
- Fix popups
|
||||||
|
|
||||||
- Pixel Grid
|
|
||||||
- Another currentLayer.canvas
|
|
||||||
- Must be rescaled each zoom
|
|
||||||
|
|
||||||
- Possibly add collaborate function
|
- Possibly add collaborate function
|
||||||
- Bug fix
|
|
||||||
- Alt + scroll broken
|
|
||||||
|
|
||||||
- Polish:
|
- Polish:
|
||||||
- Show colors which would need to be added to palette
|
- Show colors which would need to be added to palette
|
||||||
|
@ -1,10 +1,19 @@
|
|||||||
// This script contains all the functions used to manage the checkboard
|
// This script contains all the functions used to manage the checkboard
|
||||||
|
// Checkerboard color 1
|
||||||
|
var firstCheckerBoardColor = 'rgba(179, 173, 182, 1)';
|
||||||
|
// Checkerboard color 2
|
||||||
|
var secondCheckerBoardColor = 'rgba(204, 200, 206, 1)';
|
||||||
|
// Square size for the checkerboard
|
||||||
|
var checkerBoardSquareSize = 16;
|
||||||
|
// Checkerboard canvas
|
||||||
|
var checkerBoardCanvas = document.getElementById('checkerboard');
|
||||||
|
|
||||||
// Setting current colour (each square has a different colour
|
// Setting current colour (each square has a different colour
|
||||||
var currentColor = firstCheckerBoardColor;
|
var currentColor = firstCheckerBoardColor;
|
||||||
// Saving number of squares filled until now
|
// Saving number of squares filled until now
|
||||||
var nSquaresFilled = 0;
|
var nSquaresFilled = 0;
|
||||||
|
|
||||||
|
|
||||||
function fillCheckerboard() {
|
function fillCheckerboard() {
|
||||||
// Getting checkerboard context
|
// Getting checkerboard context
|
||||||
var context = checkerBoard.context;
|
var context = checkerBoard.context;
|
||||||
|
@ -56,6 +56,9 @@ function newPixel (width, height, editorMode, fileContent = null) {
|
|||||||
// Tmp layer to draw previews on
|
// Tmp layer to draw previews on
|
||||||
TMPLayer = new Layer(width, height, TMPCanvas);
|
TMPLayer = new Layer(width, height, TMPCanvas);
|
||||||
|
|
||||||
|
// Pixel grid
|
||||||
|
pixelGrid = new Layer(width, height, pixelGridCanvas);
|
||||||
|
|
||||||
canvasSize = currentLayer.canvasSize;
|
canvasSize = currentLayer.canvasSize;
|
||||||
|
|
||||||
if (firstPixel) {
|
if (firstPixel) {
|
||||||
|
1
js/_pixelGrid.js
Normal file
1
js/_pixelGrid.js
Normal file
@ -0,0 +1 @@
|
|||||||
|
pixelGridCanvas = document.getElementById("pixel-grid");
|
@ -7,16 +7,6 @@ var dialogueOpen = false;
|
|||||||
var documentCreated = false;
|
var documentCreated = false;
|
||||||
var pixelEditorMode;
|
var pixelEditorMode;
|
||||||
|
|
||||||
// Checkerboard management
|
|
||||||
// Checkerboard color 1
|
|
||||||
var firstCheckerBoardColor = 'rgba(179, 173, 182, 1)';
|
|
||||||
// Checkerboard color 2
|
|
||||||
var secondCheckerBoardColor = 'rgba(204, 200, 206, 1)';
|
|
||||||
// Square size for the checkerboard
|
|
||||||
var checkerBoardSquareSize = 16;
|
|
||||||
// Checkerboard canvas
|
|
||||||
var checkerBoardCanvas = document.getElementById('checkerboard');
|
|
||||||
|
|
||||||
//common elements
|
//common elements
|
||||||
var brushPreview = document.getElementById("brush-preview");
|
var brushPreview = document.getElementById("brush-preview");
|
||||||
var eyedropperPreview = document.getElementById("eyedropper-preview");
|
var eyedropperPreview = document.getElementById("eyedropper-preview");
|
||||||
@ -43,3 +33,8 @@ var VFXCanvas = document.getElementById('vfx-canvas');
|
|||||||
var TMPLayer;
|
var TMPLayer;
|
||||||
// TMP canvas
|
// TMP canvas
|
||||||
var TMPCanvas = document.getElementById('tmp-canvas');
|
var TMPCanvas = document.getElementById('tmp-canvas');
|
||||||
|
|
||||||
|
// Pixel grid layer
|
||||||
|
var pixelGrid;
|
||||||
|
// Pixel grid canvas
|
||||||
|
var pixelGridCanvas;
|
@ -42,6 +42,7 @@
|
|||||||
//=include _deleteColor.js
|
//=include _deleteColor.js
|
||||||
//=include _replaceAllOfColor.js
|
//=include _replaceAllOfColor.js
|
||||||
//=include _checkerboard.js
|
//=include _checkerboard.js
|
||||||
|
//=include _pixelGrid.js
|
||||||
//=include _layer.js
|
//=include _layer.js
|
||||||
//=include _copyPaste.js
|
//=include _copyPaste.js
|
||||||
//=include _resizeCanvas.js
|
//=include _resizeCanvas.js
|
||||||
|
@ -203,6 +203,7 @@
|
|||||||
<canvas id = "tmp-canvas" class = "drawingCanvas"></canvas>
|
<canvas id = "tmp-canvas" class = "drawingCanvas"></canvas>
|
||||||
<canvas id="pixel-canvas" class = "drawingCanvas"></canvas>
|
<canvas id="pixel-canvas" class = "drawingCanvas"></canvas>
|
||||||
<canvas id="checkerboard" class = "drawingCanvas"></canvas>
|
<canvas id="checkerboard" class = "drawingCanvas"></canvas>
|
||||||
|
<canvas id="pixel-grid" class = "drawingCanvas"></canvas>
|
||||||
</div>
|
</div>
|
||||||
<div id="canvas-view-shadow"></div>
|
<div id="canvas-view-shadow"></div>
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user