diff options
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 +} |