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

BIN
main/images/defold.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 548 B

View File

@@ -1,45 +1,5 @@
name: "main"
scale_along_z: 0
embedded_instances {
id: "logo"
data: "embedded_components {\n"
" id: \"sprite\"\n"
" type: \"sprite\"\n"
" data: \"tile_set: \\\"/main/logo.atlas\\\"\\n"
"default_animation: \\\"logo\\\"\\n"
"material: \\\"/builtins/materials/sprite.material\\\"\\n"
"blend_mode: BLEND_MODE_ALPHA\\n"
"\"\n"
" position {\n"
" x: 0.0\n"
" y: 0.0\n"
" z: 0.0\n"
" }\n"
" rotation {\n"
" x: 0.0\n"
" y: 0.0\n"
" z: 0.0\n"
" w: 1.0\n"
" }\n"
"}\n"
""
position {
x: 120.02384
y: 118.89577
z: 1.0
}
rotation {
x: 0.0
y: 0.0
z: 0.0
w: 1.0
}
scale3 {
x: 1.0
y: 1.0
z: 1.0
}
}
embedded_instances {
id: "go"
data: "components {\n"
@@ -79,8 +39,8 @@ embedded_instances {
"}\n"
""
position {
x: 640.0
y: 360.0
x: 480.0
y: 640.0
z: 0.0
}
rotation {
@@ -95,3 +55,151 @@ embedded_instances {
z: 1.0
}
}
embedded_instances {
id: "logo"
data: "embedded_components {\n"
" id: \"label\"\n"
" type: \"label\"\n"
" data: \"size {\\n"
" x: 128.0\\n"
" y: 32.0\\n"
" z: 0.0\\n"
" w: 1.0\\n"
"}\\n"
"scale {\\n"
" x: 1.0\\n"
" y: 1.0\\n"
" z: 1.0\\n"
" w: 1.0\\n"
"}\\n"
"color {\\n"
" x: 1.0\\n"
" y: 1.0\\n"
" z: 1.0\\n"
" w: 1.0\\n"
"}\\n"
"outline {\\n"
" x: 0.0\\n"
" y: 0.0\\n"
" z: 0.0\\n"
" w: 1.0\\n"
"}\\n"
"shadow {\\n"
" x: 0.0\\n"
" y: 0.0\\n"
" z: 0.0\\n"
" w: 1.0\\n"
"}\\n"
"leading: 1.0\\n"
"tracking: 0.0\\n"
"pivot: PIVOT_E\\n"
"blend_mode: BLEND_MODE_ALPHA\\n"
"line_break: false\\n"
"text: \\\"QRCode: \\\"\\n"
"font: \\\"/dirtylarry/larryfont.font\\\"\\n"
"material: \\\"/builtins/fonts/label-df.material\\\"\\n"
"\"\n"
" position {\n"
" x: 200.54617\n"
" y: 47.57482\n"
" z: 0.0\n"
" }\n"
" rotation {\n"
" x: 0.0\n"
" y: 0.0\n"
" z: 0.0\n"
" w: 1.0\n"
" }\n"
"}\n"
"embedded_components {\n"
" id: \"qrcode\"\n"
" type: \"label\"\n"
" data: \"size {\\n"
" x: 128.0\\n"
" y: 32.0\\n"
" z: 0.0\\n"
" w: 1.0\\n"
"}\\n"
"scale {\\n"
" x: 1.0\\n"
" y: 1.0\\n"
" z: 1.0\\n"
" w: 1.0\\n"
"}\\n"
"color {\\n"
" x: 1.0\\n"
" y: 1.0\\n"
" z: 1.0\\n"
" w: 1.0\\n"
"}\\n"
"outline {\\n"
" x: 0.0\\n"
" y: 0.0\\n"
" z: 0.0\\n"
" w: 1.0\\n"
"}\\n"
"shadow {\\n"
" x: 0.0\\n"
" y: 0.0\\n"
" z: 0.0\\n"
" w: 1.0\\n"
"}\\n"
"leading: 1.0\\n"
"tracking: 0.0\\n"
"pivot: PIVOT_NW\\n"
"blend_mode: BLEND_MODE_ALPHA\\n"
"line_break: true\\n"
"text: \\\"...\\\"\\n"
"font: \\\"/dirtylarry/larryfont.font\\\"\\n"
"material: \\\"/builtins/fonts/label-df.material\\\"\\n"
"\"\n"
" position {\n"
" x: 73.19203\n"
" y: 21.95761\n"
" z: 0.0\n"
" }\n"
" rotation {\n"
" x: 0.0\n"
" y: 0.0\n"
" z: 0.0\n"
" w: 1.0\n"
" }\n"
"}\n"
"embedded_components {\n"
" id: \"sprite\"\n"
" type: \"sprite\"\n"
" data: \"tile_set: \\\"/main/logo.atlas\\\"\\n"
"default_animation: \\\"logo\\\"\\n"
"material: \\\"/builtins/materials/sprite.material\\\"\\n"
"blend_mode: BLEND_MODE_ALPHA\\n"
"\"\n"
" position {\n"
" x: 0.0\n"
" y: 0.0\n"
" z: 0.0\n"
" }\n"
" rotation {\n"
" x: 0.0\n"
" y: 0.0\n"
" z: 0.0\n"
" w: 1.0\n"
" }\n"
"}\n"
""
position {
x: 120.02384
y: 118.89577
z: 1.0
}
rotation {
x: 0.0
y: 0.0
z: 0.0
w: 1.0
}
scale3 {
x: 1.0
y: 1.0
z: 1.0
}
}

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