diff options
author | Joris | 2022-07-05 22:11:00 +0200 |
---|---|---|
committer | Joris | 2022-07-05 22:11:00 +0200 |
commit | 8c1ab4c5756ac43d52bc8773f5e72dde90f79e77 (patch) | |
tree | de0db8c859e4204c90ddaa762f4d743fab1dedb2 /src/screen.ts | |
parent | 1d855b7a50b61650f7ddf40f604c788de1c9e914 (diff) |
WIP
Diffstat (limited to 'src/screen.ts')
-rw-r--r-- | src/screen.ts | 11 |
1 files changed, 8 insertions, 3 deletions
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 +} |