aboutsummaryrefslogtreecommitdiff
path: root/src/screen.ts
diff options
context:
space:
mode:
authorJoris2022-07-05 22:11:00 +0200
committerJoris2022-07-05 22:11:00 +0200
commit8c1ab4c5756ac43d52bc8773f5e72dde90f79e77 (patch)
treede0db8c859e4204c90ddaa762f4d743fab1dedb2 /src/screen.ts
parent1d855b7a50b61650f7ddf40f604c788de1c9e914 (diff)
WIP
Diffstat (limited to 'src/screen.ts')
-rw-r--r--src/screen.ts11
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
+}