From 9cb8c52029f750d5fc0f365c1d89abe27905dc82 Mon Sep 17 00:00:00 2001 From: An Orbit <68935009+orbit-loona@users.noreply.github.com> Date: Tue, 2 Jan 2024 23:34:49 -0500 Subject: [PATCH] y.o.y. did u define resizeCanvas in the long-ass end-of-loading function --- mods/a_mod_by_alice.js | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/mods/a_mod_by_alice.js b/mods/a_mod_by_alice.js index 4a83b6c5..46647699 100644 --- a/mods/a_mod_by_alice.js +++ b/mods/a_mod_by_alice.js @@ -2193,6 +2193,20 @@ color1 and color2 spread through striped paint like dye does with itself. col //ENABLE RUNNING CODE AFTER STATE ELEMENT AUTOGENERATION (runAfterAutogen) ## + resizeCanvas = function(newHeight,newWidth,newPixelSize,clear) { + var gameCanvas = document.getElementById("game"); + var ctx = gameCanvas.getContext("2d"); + ctx.canvas.width = newWidth; + ctx.canvas.height = newHeight; + document.getElementById("gameDiv").style.width = newWidth + "px"; + pixelSize = newPixelSize; + pixelSizeHalf = newPixelSize/2; + height = Math.round(newHeight/newPixelSize)-1; + width = Math.round(newWidth/newPixelSize)-1; + mousePos = {x:width/2,y:height/2}; + if (clear!==false) { clearAll(); } + } + function runAfterAutogen(func) { runAfterAutogenList.push(func); };