mirror of
https://github.com/defold/extension-camera
synced 2025-06-27 10:27:45 +02:00
Compare commits
3 Commits
Author | SHA1 | Date | |
---|---|---|---|
|
5db8d5c072 | ||
|
851f3dee87 | ||
|
73c3596156 |
@ -1,18 +1,10 @@
|
|||||||
name: "Camera"
|
name: "Camera"
|
||||||
|
|
||||||
platforms:
|
platforms:
|
||||||
x86_64-osx:
|
osx:
|
||||||
context:
|
|
||||||
frameworks: ["AVFoundation", "CoreMedia"]
|
|
||||||
|
|
||||||
x86-osx:
|
|
||||||
context:
|
context:
|
||||||
frameworks: ["AVFoundation", "CoreMedia"]
|
frameworks: ["AVFoundation", "CoreMedia"]
|
||||||
|
|
||||||
arm64-ios:
|
ios:
|
||||||
context:
|
|
||||||
frameworks: ["AVFoundation", "CoreMedia", "UIKit"]
|
|
||||||
|
|
||||||
armv7-ios:
|
|
||||||
context:
|
context:
|
||||||
frameworks: ["AVFoundation", "CoreMedia", "UIKit"]
|
frameworks: ["AVFoundation", "CoreMedia", "UIKit"]
|
||||||
|
@ -35,6 +35,3 @@ tccutil reset Camera
|
|||||||
## Source code
|
## Source code
|
||||||
|
|
||||||
The source code is available on [GitHub](https://github.com/defold/extension-camera)
|
The source code is available on [GitHub](https://github.com/defold/extension-camera)
|
||||||
|
|
||||||
|
|
||||||
## API reference
|
|
||||||
|
8
main/default.font
Normal file
8
main/default.font
Normal file
@ -0,0 +1,8 @@
|
|||||||
|
font: "/builtins/fonts/vera_mo_bd.ttf"
|
||||||
|
material: "/builtins/fonts/font-df.material"
|
||||||
|
size: 14
|
||||||
|
antialias: 1
|
||||||
|
alpha: 1.0
|
||||||
|
shadow_alpha: 0.0
|
||||||
|
shadow_blur: 0
|
||||||
|
output_format: TYPE_DISTANCE_FIELD
|
@ -16,14 +16,19 @@ embedded_instances {
|
|||||||
" z: 0.0\n"
|
" z: 0.0\n"
|
||||||
" w: 1.0\n"
|
" w: 1.0\n"
|
||||||
" }\n"
|
" }\n"
|
||||||
|
" property_decls {\n"
|
||||||
|
" }\n"
|
||||||
"}\n"
|
"}\n"
|
||||||
"embedded_components {\n"
|
"embedded_components {\n"
|
||||||
" id: \"sprite\"\n"
|
" id: \"sprite\"\n"
|
||||||
" type: \"sprite\"\n"
|
" type: \"sprite\"\n"
|
||||||
" data: \"tile_set: \\\"/main/camera.atlas\\\"\\n"
|
" data: \"default_animation: \\\"logo\\\"\\n"
|
||||||
"default_animation: \\\"logo\\\"\\n"
|
|
||||||
"material: \\\"/builtins/materials/sprite.material\\\"\\n"
|
"material: \\\"/builtins/materials/sprite.material\\\"\\n"
|
||||||
"blend_mode: BLEND_MODE_ALPHA\\n"
|
"blend_mode: BLEND_MODE_ALPHA\\n"
|
||||||
|
"textures {\\n"
|
||||||
|
" sampler: \\\"texture_sampler\\\"\\n"
|
||||||
|
" texture: \\\"/main/camera.atlas\\\"\\n"
|
||||||
|
"}\\n"
|
||||||
"\"\n"
|
"\"\n"
|
||||||
" position {\n"
|
" position {\n"
|
||||||
" x: 0.0\n"
|
" x: 0.0\n"
|
||||||
@ -60,10 +65,13 @@ embedded_instances {
|
|||||||
data: "embedded_components {\n"
|
data: "embedded_components {\n"
|
||||||
" id: \"sprite\"\n"
|
" id: \"sprite\"\n"
|
||||||
" type: \"sprite\"\n"
|
" type: \"sprite\"\n"
|
||||||
" data: \"tile_set: \\\"/main/logo.atlas\\\"\\n"
|
" data: \"default_animation: \\\"logo\\\"\\n"
|
||||||
"default_animation: \\\"logo\\\"\\n"
|
|
||||||
"material: \\\"/builtins/materials/sprite.material\\\"\\n"
|
"material: \\\"/builtins/materials/sprite.material\\\"\\n"
|
||||||
"blend_mode: BLEND_MODE_ALPHA\\n"
|
"blend_mode: BLEND_MODE_ALPHA\\n"
|
||||||
|
"textures {\\n"
|
||||||
|
" sampler: \\\"texture_sampler\\\"\\n"
|
||||||
|
" texture: \\\"/main/logo.atlas\\\"\\n"
|
||||||
|
"}\\n"
|
||||||
"\"\n"
|
"\"\n"
|
||||||
" position {\n"
|
" position {\n"
|
||||||
" x: 0.0\n"
|
" x: 0.0\n"
|
||||||
@ -86,12 +94,6 @@ embedded_instances {
|
|||||||
" z: 0.0\\n"
|
" z: 0.0\\n"
|
||||||
" w: 0.0\\n"
|
" w: 0.0\\n"
|
||||||
"}\\n"
|
"}\\n"
|
||||||
"scale {\\n"
|
|
||||||
" x: 1.0\\n"
|
|
||||||
" y: 1.0\\n"
|
|
||||||
" z: 1.0\\n"
|
|
||||||
" w: 0.0\\n"
|
|
||||||
"}\\n"
|
|
||||||
"color {\\n"
|
"color {\\n"
|
||||||
" x: 1.0\\n"
|
" x: 1.0\\n"
|
||||||
" y: 1.0\\n"
|
" y: 1.0\\n"
|
||||||
@ -116,8 +118,8 @@ embedded_instances {
|
|||||||
"blend_mode: BLEND_MODE_ALPHA\\n"
|
"blend_mode: BLEND_MODE_ALPHA\\n"
|
||||||
"line_break: false\\n"
|
"line_break: false\\n"
|
||||||
"text: \\\"Space/Touch to toggle capture\\\"\\n"
|
"text: \\\"Space/Touch to toggle capture\\\"\\n"
|
||||||
"font: \\\"/builtins/fonts/system_font.font\\\"\\n"
|
"font: \\\"/main/default.font\\\"\\n"
|
||||||
"material: \\\"/builtins/fonts/label.material\\\"\\n"
|
"material: \\\"/builtins/fonts/label-df.material\\\"\\n"
|
||||||
"\"\n"
|
"\"\n"
|
||||||
" position {\n"
|
" position {\n"
|
||||||
" x: 90.0\n"
|
" x: 90.0\n"
|
||||||
@ -140,12 +142,6 @@ embedded_instances {
|
|||||||
" z: 0.0\\n"
|
" z: 0.0\\n"
|
||||||
" w: 0.0\\n"
|
" w: 0.0\\n"
|
||||||
"}\\n"
|
"}\\n"
|
||||||
"scale {\\n"
|
|
||||||
" x: 1.0\\n"
|
|
||||||
" y: 1.0\\n"
|
|
||||||
" z: 1.0\\n"
|
|
||||||
" w: 0.0\\n"
|
|
||||||
"}\\n"
|
|
||||||
"color {\\n"
|
"color {\\n"
|
||||||
" x: 1.0\\n"
|
" x: 1.0\\n"
|
||||||
" y: 1.0\\n"
|
" y: 1.0\\n"
|
||||||
@ -172,8 +168,8 @@ embedded_instances {
|
|||||||
"text: \\\"label\\\\n"
|
"text: \\\"label\\\\n"
|
||||||
"\\\"\\n"
|
"\\\"\\n"
|
||||||
" \\\"\\\"\\n"
|
" \\\"\\\"\\n"
|
||||||
"font: \\\"/builtins/fonts/system_font.font\\\"\\n"
|
"font: \\\"/main/default.font\\\"\\n"
|
||||||
"material: \\\"/builtins/fonts/label.material\\\"\\n"
|
"material: \\\"/builtins/fonts/label-df.material\\\"\\n"
|
||||||
"\"\n"
|
"\"\n"
|
||||||
" position {\n"
|
" position {\n"
|
||||||
" x: 90.0\n"
|
" x: 90.0\n"
|
||||||
|
@ -3,7 +3,6 @@ local function stop_capture(self)
|
|||||||
if self.cameraframe == nil then
|
if self.cameraframe == nil then
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
|
|
||||||
self.cameraframe = nil
|
self.cameraframe = nil
|
||||||
camera.stop_capture()
|
camera.stop_capture()
|
||||||
|
|
||||||
@ -24,7 +23,7 @@ local function start_capture(self)
|
|||||||
type = camera.CAMERA_TYPE_BACK
|
type = camera.CAMERA_TYPE_BACK
|
||||||
quality = camera.CAPTURE_QUALITY_MEDIUM
|
quality = camera.CAPTURE_QUALITY_MEDIUM
|
||||||
end
|
end
|
||||||
|
|
||||||
camera.start_capture(type, quality, function(self, status)
|
camera.start_capture(type, quality, function(self, status)
|
||||||
if status == camera.CAMERA_STARTED then
|
if status == camera.CAMERA_STARTED then
|
||||||
self.cameraframe = camera.get_frame()
|
self.cameraframe = camera.get_frame()
|
||||||
|
Loading…
x
Reference in New Issue
Block a user