game-engine/modules/utils.js

7 lines
214 B
JavaScript

export function createCanvas(width, height) {
const canvas = document.createElement("canvas");
canvas.width = width;
canvas.height = height;
const ctx = canvas.getContext("2d");
return { ctx, canvas };
}