summaryrefslogtreecommitdiff
path: root/Camera.lua
diff options
context:
space:
mode:
Diffstat (limited to 'Camera.lua')
-rw-r--r--Camera.lua4
1 files changed, 4 insertions, 0 deletions
diff --git a/Camera.lua b/Camera.lua
index 3b3f1a3..5a9c87b 100644
--- a/Camera.lua
+++ b/Camera.lua
@@ -5,6 +5,10 @@ local Transform = require 'Transform'
local Camera = component({Transform})
function Camera:use()
+ self.obj.world.camera = self
+end
+
+function Camera:transform()
local trans = self.obj:get(Transform):love()
local cam_trans = love.math.newTransform(1920 / 2, 1080 / 2)
love.graphics.applyTransform(cam_trans * trans:inverse())