2023-11-20 20:33:21 -05:00
|
|
|
pixelResizeButton = document.createElement("button");
|
|
|
|
|
pixelResizeButton.onclick = function(pixel) {
|
|
|
|
|
let canvas_width = document.getElementById("game").width;
|
|
|
|
|
let canvas_height = document.getElementById("game").height;
|
2025-08-27 19:53:31 -04:00
|
|
|
promptInput("How big should pixels be?", (pixelSizeNeeded) => {
|
|
|
|
|
// let pixelSizeNeeded = prompt("How big should pixels be?");
|
|
|
|
|
if (!pixelSizeNeeded || isNaN(pixelSizeNeeded)) {
|
|
|
|
|
// alert('number is invalid!');
|
|
|
|
|
promptText("Number is invalid!");
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
resizeCanvas(canvas_height,canvas_width, parseFloat(pixelSizeNeeded), true);
|
|
|
|
|
},"Pixel Size")
|
2023-11-20 20:33:21 -05:00
|
|
|
};
|
2023-11-20 20:37:36 -05:00
|
|
|
pixelResizeButton.textContent = "Resize";
|
2023-11-30 22:22:53 -05:00
|
|
|
window.addEventListener("load",function(){
|
|
|
|
|
document.getElementById("toolControls").appendChild(pixelResizeButton);
|
|
|
|
|
});
|