From 8c1ab4c5756ac43d52bc8773f5e72dde90f79e77 Mon Sep 17 00:00:00 2001 From: Joris Date: Tue, 5 Jul 2022 22:11:00 +0200 Subject: WIP --- src/screen.ts | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) (limited to 'src/screen.ts') diff --git a/src/screen.ts b/src/screen.ts index 930534e..0567ad9 100644 --- a/src/screen.ts +++ b/src/screen.ts @@ -1,4 +1,9 @@ -let canvas = document.querySelector('canvas') as HTMLCanvasElement +export let size = { + x: window.innerWidth, + y: window.innerHeight +} -export let width: number = canvas.width -export let height: number = canvas.height +window.onresize = () => { + size.x = window.innerWidth + size.y = window.innerHeight +} -- cgit v1.2.3