diff options
Diffstat (limited to 'Camera.lua')
-rw-r--r-- | Camera.lua | 4 |
1 files changed, 4 insertions, 0 deletions
@@ -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()) |