game-engine/modules/utils.js

8 lines
214 B
JavaScript
Raw Normal View History

2024-09-13 21:45:59 -05:00
export function createCanvas(width, height) {
const canvas = document.createElement("canvas");
canvas.width = width;
canvas.height = height;
const ctx = canvas.getContext("2d");
return { ctx, canvas };
}