canvas now argument
This commit is contained in:
parent
1e51b6a63b
commit
f056459b81
@ -3,8 +3,8 @@ import { Settings } from './settings.js';
|
||||
import { Pointer } from './pointer.js';
|
||||
|
||||
export class App {
|
||||
constructor(w, h) {
|
||||
this.canvas = document.querySelector('canvas');
|
||||
constructor(canvas, w, h) {
|
||||
this.canvas = canvas;
|
||||
this.context = this.canvas.getContext('2d');
|
||||
|
||||
this.scene = new Scene(this.canvas, this.context, w, h);
|
||||
|
@ -1,5 +1,5 @@
|
||||
import { App } from './app.js';
|
||||
|
||||
window.addEventListener('DOMContentLoaded', () => {
|
||||
new App(400, 400);
|
||||
new App(document.querySelector('canvas'), 400, 400);
|
||||
});
|
||||
|
Loading…
Reference in New Issue
Block a user