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;
|
2023-11-20 20:37:36 -05:00
|
|
|
let pixelSizeNeeded = prompt("How big should pixels be?");
|
2023-11-29 20:37:29 -05:00
|
|
|
if (!pixelSizeNeeded || isNaN(pixelSizeNeeded)) { alert('number is invalid!'); return; }
|
2023-11-20 20:37:36 -05:00
|
|
|
resizeCanvas(canvas_height,canvas_width, parseFloat(pixelSizeNeeded), true);
|
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);
|
|
|
|
|
});
|