Initial commit

This commit is contained in:
2026-10-31 23:35:38 -05:00
parent 652d95803b
commit 6833e7acd5
10 changed files with 908 additions and 0 deletions
@@ -0,0 +1,29 @@
const setupScriptRunner = () => {
canvasContext = canvas.getContext("2d");
Painter.canvas = canvas;
Painter.canvasContext = canvasContext;
}
const runScript = () => {
setToCenter();
resetRotation();
clearCanvas();
for (const elm of script.children) {
elm.action(Painter);
}
}
const setToCenter = () => {
Painter.x1 = Painter.canvas.width / 2
Painter.y1 = Painter.canvas.height / 2
Painter.canvasContext.moveTo( Painter.x1, Painter.y1 );
}
const clearCanvas = () => {
Painter.canvasContext.clearRect(0, 0, canvas.width, canvas.height);
}
const resetRotation = () => {
Painter.rotation = 0;
}