2024.js/island.ts

23 lines
457 B
TypeScript
Raw Normal View History

2024-01-12 20:46:09 -05:00
import { canvas2d } from "./lib/html";
2024-01-12 20:21:58 -05:00
const BLOWUP = 4;
const WIDTH = 240;
const HEIGHT = 135;
export function IslandApplet() {
2024-01-12 20:46:09 -05:00
const [canvas, cx] = canvas2d({
2024-01-12 20:21:58 -05:00
width: WIDTH * BLOWUP,
height: HEIGHT * BLOWUP,
2024-01-12 20:46:09 -05:00
});
2024-01-12 20:21:58 -05:00
cx.scale(BLOWUP, BLOWUP);
cx.fillStyle = "red";
cx.fillRect(0, 0, WIDTH, HEIGHT);
cx.fillStyle = "blue";
cx.fillRect(1, 1, WIDTH - 2, HEIGHT - 2);
return [canvas];
}
(globalThis as any).IslandApplet = IslandApplet;