Apologies if I missed it, but I wasn't able to find any talk on the camera module in this thread. Do you know of a working example somewhere? I'm having some problems getting it to work, and not sure if I'm just doing something stupid / overlooking something.
I'm able to create a camera object by doing like so:
Code: Select all
Vector = require 'library/hump/vector.lua'
Camera = require 'library/hump/camera.lua'
But when I try to call mainCamera:attach() I get the following error:
http://imgur.com/a5eOz
But if I instead initialize the camera like so:
Code: Select all
mainCamera = Camera:new(Vector(100,100), 2, math.pi/2)
then the error I get is:
http://imgur.com/fNhID
Edit: I had initially assumed that the vector was being incorrectly read as not-a-vector, but upon further investigation... In the camera class I decided to check why exactly the assert was failing:
Code: Select all
local typeStr = string.format("zoom is of type: %s", type(self.zoom))
assert(type(self.zoom) == "number", typeStr)
yields:
It seems that the camera's fields are incorrect, though I'm still unsure what correct solution would be.