A first version

This commit is contained in:
Mathias Westerdahl
2017-02-24 17:54:40 +01:00
parent dfded3e738
commit fccebd8f6d
14 changed files with 11358 additions and 45 deletions

View File

@@ -34,6 +34,10 @@ function init(self)
else
print("could not start camera capture")
end
if qrcode == nil then
print("could not find qrcode module")
end
end
function final(self)
@@ -47,6 +51,14 @@ function update(self, dt)
if self.cameraframe then
local pathmodelcamera = go.get("#sprite", "texture0")
resource.set_texture(pathmodelcamera, self.cameratextureheader, self.cameraframe)
local url = qrcode.scan(self.cameraframe, self.camerainfo.width, self.camerainfo.height)
if url ~= nil then
label.set_text("logo#qrcode", url)
else
label.set_text("logo#qrcode", "...")
end
end