summaryrefslogtreecommitdiff
path: root/scripts/cameraHandleResize.lua
diff options
context:
space:
mode:
Diffstat (limited to 'scripts/cameraHandleResize.lua')
-rw-r--r--scripts/cameraHandleResize.lua6
1 files changed, 6 insertions, 0 deletions
diff --git a/scripts/cameraHandleResize.lua b/scripts/cameraHandleResize.lua
new file mode 100644
index 0000000..7d1713d
--- /dev/null
+++ b/scripts/cameraHandleResize.lua
@@ -0,0 +1,6 @@
+return function(entities, id, data)
+ local camera = entities:getComponent(id, "camera")
+ if camera then
+ camera.projection:perspectiveResize(data.width/data.height)
+ end
+end