Create pixelResizeTool.js

This commit is contained in:
feeshmaster 2023-11-20 19:33:21 -06:00 committed by GitHub
parent efd153c415
commit 45d7aa910d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 9 additions and 0 deletions

9
mods/pixelResizeTool.js Normal file
View File

@ -0,0 +1,9 @@
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 of pixels you want");
resizeCanvas(canvas_height,canvas_width, pixelSizeNeeded, true);
};
pixelResizeButton.textContent = "resize pixels";
document.getElementById("toolControls").appendChild(pixelResizeButton);