ujs/src/js/scene.js

27 lines
419 B
JavaScript

import { Pointer } from './pointer.js';
export class Scene {
constructor() {
this.init();
}
init = async () => {
this.canvas = document.querySelector('canvas');
this.context = this.canvas.getContext('2d');
this.setScreenSize();
}
run() {
console.log(Pointer.pos);
}
setScreenSize() {
let w = 640;
let h = 480;
this.canvas.width = w;
this.canvas.height = h;
}
}