Merge pull request #146 from feeshmaster/patch-1

Create pixelResizeTool.js
This commit is contained in:
slweeb 2023-11-20 20:37:46 -05:00 committed by GitHub
commit 7a7a13766c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 10 additions and 0 deletions

10
mods/pixelResizeTool.js Normal file
View File

@ -0,0 +1,10 @@
pixelResizeButton = document.createElement("button");
pixelResizeButton.onclick = function(pixel) {
let canvas_width = document.getElementById("game").width;
let canvas_height = document.getElementById("game").height;
let pixelSizeNeeded = prompt("How big should pixels be?");
if (!pixelSizeNeeded) { return }
resizeCanvas(canvas_height,canvas_width, parseFloat(pixelSizeNeeded), true);
};
pixelResizeButton.textContent = "Resize";
document.getElementById("toolControls").appendChild(pixelResizeButton);