mirror of
https://github.com/defold/extension-camera
synced 2025-06-27 18:37:43 +02:00
WIP
This commit is contained in:
parent
4ef2a427e7
commit
7258633994
48
Info.plist
Normal file
48
Info.plist
Normal file
@ -0,0 +1,48 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
||||||
|
<plist version="1.0">
|
||||||
|
<dict>
|
||||||
|
<key>BuildMachineOSBuild</key>
|
||||||
|
<string>11E53</string>
|
||||||
|
<key>CFBundleDevelopmentRegion</key>
|
||||||
|
<string>{{osx.default_language}}</string>
|
||||||
|
<key>CFBundleDisplayName</key>
|
||||||
|
<string>{{project.title}}</string>
|
||||||
|
<key>CFBundleExecutable</key>
|
||||||
|
<string>{{exe-name}}</string>
|
||||||
|
<key>CFBundleIconFile</key>
|
||||||
|
<string>icon.icns</string>
|
||||||
|
<key>CFBundleIdentifier</key>
|
||||||
|
<string>{{osx.bundle_identifier}}</string>
|
||||||
|
<key>CFBundleInfoDictionaryVersion</key>
|
||||||
|
<string>6.0</string>
|
||||||
|
<key>CFBundleName</key>
|
||||||
|
<string>unnamed</string>
|
||||||
|
<key>CFBundlePackageType</key>
|
||||||
|
<string>APPL</string>
|
||||||
|
<key>CFBundleShortVersionString</key>
|
||||||
|
<string>{{project.version}}</string>
|
||||||
|
<key>CFBundleSignature</key>
|
||||||
|
<string>????</string>
|
||||||
|
<key>CFBundleLocalizations</key>
|
||||||
|
<array>{{#application-localizations}}
|
||||||
|
<string>{{.}}</string>{{/application-localizations}}
|
||||||
|
</array>
|
||||||
|
<key>CFBundleVersion</key>
|
||||||
|
<string>1</string>
|
||||||
|
<key>LSMinimumSystemVersion</key>
|
||||||
|
<string>10.7</string>
|
||||||
|
<key>NSMainNibFile</key>
|
||||||
|
<string>MainMenu</string>
|
||||||
|
<key>NSPrincipalClass</key>
|
||||||
|
<string>NSApplication</string>
|
||||||
|
<key>NSCameraUsageDescription</key>
|
||||||
|
<string>App Needs to use camera to take Profile picture</string>
|
||||||
|
<key>NSPhotoLibraryAddUsageDescription</key>
|
||||||
|
<string>App Needs to store your photos</string>
|
||||||
|
{{#display.high_dpi}}
|
||||||
|
<key>NSHighResolutionCapable</key>
|
||||||
|
<true/>
|
||||||
|
{{/display.high_dpi}}
|
||||||
|
</dict>
|
||||||
|
</plist>
|
@ -26,26 +26,69 @@ struct DefoldCamera
|
|||||||
|
|
||||||
// Information about the currently set camera
|
// Information about the currently set camera
|
||||||
CameraInfo m_Params;
|
CameraInfo m_Params;
|
||||||
|
|
||||||
|
dmArray<CameraStatus> m_MessageQueue;
|
||||||
|
dmScript::LuaCallbackInfo* m_Callback;
|
||||||
|
dmMutex::HMutex m_Mutex;
|
||||||
};
|
};
|
||||||
|
|
||||||
DefoldCamera g_DefoldCamera;
|
DefoldCamera g_DefoldCamera;
|
||||||
|
|
||||||
|
|
||||||
|
void Camera_QueueMessage(CameraStatus status)
|
||||||
|
{
|
||||||
|
DM_MUTEX_SCOPED_LOCK(g_DefoldCamera.m_Mutex);
|
||||||
|
|
||||||
|
if (g_DefoldCamera.m_MessageQueue.Full())
|
||||||
|
{
|
||||||
|
g_DefoldCamera.m_MessageQueue.OffsetCapacity(1);
|
||||||
|
}
|
||||||
|
g_DefoldCamera.m_MessageQueue.Push(status);
|
||||||
|
}
|
||||||
|
|
||||||
|
static void Camera_ProcessQueue()
|
||||||
|
{
|
||||||
|
DM_MUTEX_SCOPED_LOCK(g_DefoldCamera.m_Mutex);
|
||||||
|
|
||||||
|
for (uint32_t i = 0; i != g_DefoldCamera.m_MessageQueue.Size(); ++i)
|
||||||
|
{
|
||||||
|
lua_State* L = dmScript::GetCallbackLuaContext(g_DefoldCamera.m_Callback);
|
||||||
|
if (!dmScript::SetupCallback(g_DefoldCamera.m_Callback))
|
||||||
|
{
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
CameraStatus status = g_DefoldCamera.m_MessageQueue[i];
|
||||||
|
lua_pushnumber(L, (lua_Number)status);
|
||||||
|
int ret = lua_pcall(L, 2, 0, 0);
|
||||||
|
if (ret != 0)
|
||||||
|
{
|
||||||
|
lua_pop(L, 1);
|
||||||
|
}
|
||||||
|
dmScript::TeardownCallback(g_DefoldCamera.m_Callback);
|
||||||
|
}
|
||||||
|
g_DefoldCamera.m_MessageQueue.SetSize(0);
|
||||||
|
}
|
||||||
|
|
||||||
|
static void Camera_DestroyCallback()
|
||||||
|
{
|
||||||
|
if (g_DefoldCamera.m_Callback != 0)
|
||||||
|
{
|
||||||
|
dmScript::DestroyCallback(g_DefoldCamera.m_Callback);
|
||||||
|
g_DefoldCamera.m_Callback = 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
static int StartCapture(lua_State* L)
|
static int StartCapture(lua_State* L)
|
||||||
{
|
{
|
||||||
DM_LUA_STACK_CHECK(L, 1);
|
DM_LUA_STACK_CHECK(L, 0);
|
||||||
|
|
||||||
CameraType type = (CameraType) luaL_checkint(L, 1);
|
CameraType type = (CameraType) luaL_checkint(L, 1);
|
||||||
CaptureQuality quality = (CaptureQuality)luaL_checkint(L, 2);
|
CaptureQuality quality = (CaptureQuality)luaL_checkint(L, 2);
|
||||||
|
|
||||||
int status = CameraPlatform_StartCapture(&g_DefoldCamera.m_VideoBuffer, type, quality, g_DefoldCamera.m_Params);
|
Camera_DestroyCallback();
|
||||||
|
g_DefoldCamera.m_Callback = dmScript::CreateCallback(L, 3);
|
||||||
|
|
||||||
lua_pushboolean(L, status > 0);
|
CameraPlatform_StartCapture(&g_DefoldCamera.m_VideoBuffer, type, quality, g_DefoldCamera.m_Params);
|
||||||
if( status == 0 )
|
|
||||||
{
|
|
||||||
dmLogError("capture failed!\n");
|
|
||||||
return 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Increase ref count
|
// Increase ref count
|
||||||
dmScript::LuaHBuffer luabuffer = {g_DefoldCamera.m_VideoBuffer, false};
|
dmScript::LuaHBuffer luabuffer = {g_DefoldCamera.m_VideoBuffer, false};
|
||||||
@ -59,14 +102,9 @@ static int StopCapture(lua_State* L)
|
|||||||
{
|
{
|
||||||
DM_LUA_STACK_CHECK(L, 0);
|
DM_LUA_STACK_CHECK(L, 0);
|
||||||
|
|
||||||
int status = CameraPlatform_StopCapture();
|
CameraPlatform_StopCapture();
|
||||||
if( !status )
|
|
||||||
{
|
|
||||||
return luaL_error(L, "Failed to stop capture. Was it started?");
|
|
||||||
}
|
|
||||||
|
|
||||||
dmScript::Unref(L, LUA_REGISTRYINDEX, g_DefoldCamera.m_VideoBufferLuaRef); // We want it destroyed by the GC
|
dmScript::Unref(L, LUA_REGISTRYINDEX, g_DefoldCamera.m_VideoBufferLuaRef); // We want it destroyed by the GC
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -113,9 +151,9 @@ static void LuaInit(lua_State* L)
|
|||||||
int top = lua_gettop(L);
|
int top = lua_gettop(L);
|
||||||
luaL_register(L, MODULE_NAME, Module_methods);
|
luaL_register(L, MODULE_NAME, Module_methods);
|
||||||
|
|
||||||
#define SETCONSTANT(name) \
|
#define SETCONSTANT(name) \
|
||||||
lua_pushnumber(L, (lua_Number) name); \
|
lua_pushnumber(L, (lua_Number) name); \
|
||||||
lua_setfield(L, -2, #name);\
|
lua_setfield(L, -2, #name);\
|
||||||
|
|
||||||
SETCONSTANT(CAMERA_TYPE_FRONT)
|
SETCONSTANT(CAMERA_TYPE_FRONT)
|
||||||
SETCONSTANT(CAMERA_TYPE_BACK)
|
SETCONSTANT(CAMERA_TYPE_BACK)
|
||||||
@ -124,7 +162,12 @@ static void LuaInit(lua_State* L)
|
|||||||
SETCONSTANT(CAPTURE_QUALITY_MEDIUM)
|
SETCONSTANT(CAPTURE_QUALITY_MEDIUM)
|
||||||
SETCONSTANT(CAPTURE_QUALITY_HIGH)
|
SETCONSTANT(CAPTURE_QUALITY_HIGH)
|
||||||
|
|
||||||
#undef SETCONSTANT
|
SETCONSTANT(STATUS_STARTED)
|
||||||
|
SETCONSTANT(STATUS_STOPPED)
|
||||||
|
SETCONSTANT(STATUS_NOT_PERMITTED)
|
||||||
|
SETCONSTANT(STATUS_ERROR)
|
||||||
|
|
||||||
|
#undef SETCONSTANT
|
||||||
|
|
||||||
lua_pop(L, 1);
|
lua_pop(L, 1);
|
||||||
assert(top == lua_gettop(L));
|
assert(top == lua_gettop(L));
|
||||||
@ -132,12 +175,20 @@ static void LuaInit(lua_State* L)
|
|||||||
|
|
||||||
dmExtension::Result AppInitializeCamera(dmExtension::AppParams* params)
|
dmExtension::Result AppInitializeCamera(dmExtension::AppParams* params)
|
||||||
{
|
{
|
||||||
|
dmLogInfo("Registered %s Extension", MODULE_NAME);
|
||||||
return dmExtension::RESULT_OK;
|
return dmExtension::RESULT_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
dmExtension::Result InitializeCamera(dmExtension::Params* params)
|
dmExtension::Result InitializeCamera(dmExtension::Params* params)
|
||||||
{
|
{
|
||||||
LuaInit(params->m_L);
|
LuaInit(params->m_L);
|
||||||
|
g_DefoldCamera.m_Mutex = dmMutex::New();
|
||||||
|
return dmExtension::RESULT_OK;
|
||||||
|
}
|
||||||
|
|
||||||
|
static dmExtension::Result UpdateCamera(dmExtension::Params* params)
|
||||||
|
{
|
||||||
|
Camera_ProcessQueue();
|
||||||
return dmExtension::RESULT_OK;
|
return dmExtension::RESULT_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -148,6 +199,8 @@ dmExtension::Result AppFinalizeCamera(dmExtension::AppParams* params)
|
|||||||
|
|
||||||
dmExtension::Result FinalizeCamera(dmExtension::Params* params)
|
dmExtension::Result FinalizeCamera(dmExtension::Params* params)
|
||||||
{
|
{
|
||||||
|
dmMutex::Delete(g_DefoldCamera.m_Mutex);
|
||||||
|
Camera_DestroyCallback();
|
||||||
return dmExtension::RESULT_OK;
|
return dmExtension::RESULT_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -156,7 +209,7 @@ dmExtension::Result FinalizeCamera(dmExtension::Params* params)
|
|||||||
|
|
||||||
static dmExtension::Result AppInitializeCamera(dmExtension::AppParams* params)
|
static dmExtension::Result AppInitializeCamera(dmExtension::AppParams* params)
|
||||||
{
|
{
|
||||||
dmLogInfo("Registered %s (null) Extension\n", MODULE_NAME);
|
dmLogInfo("Registered %s (null) Extension", MODULE_NAME);
|
||||||
return dmExtension::RESULT_OK;
|
return dmExtension::RESULT_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -165,6 +218,12 @@ static dmExtension::Result InitializeCamera(dmExtension::Params* params)
|
|||||||
return dmExtension::RESULT_OK;
|
return dmExtension::RESULT_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static dmExtension::Result UpdateCamera(dmExtension::Params* params)
|
||||||
|
{
|
||||||
|
Camera_ProcessQueue()
|
||||||
|
return dmExtension::RESULT_OK;
|
||||||
|
}
|
||||||
|
|
||||||
static dmExtension::Result AppFinalizeCamera(dmExtension::AppParams* params)
|
static dmExtension::Result AppFinalizeCamera(dmExtension::AppParams* params)
|
||||||
{
|
{
|
||||||
return dmExtension::RESULT_OK;
|
return dmExtension::RESULT_OK;
|
||||||
@ -178,4 +237,4 @@ static dmExtension::Result FinalizeCamera(dmExtension::Params* params)
|
|||||||
#endif // platforms
|
#endif // platforms
|
||||||
|
|
||||||
|
|
||||||
DM_DECLARE_EXTENSION(EXTENSION_NAME, LIB_NAME, AppInitializeCamera, AppFinalizeCamera, InitializeCamera, 0, 0, FinalizeCamera)
|
DM_DECLARE_EXTENSION(EXTENSION_NAME, LIB_NAME, AppInitializeCamera, AppFinalizeCamera, InitializeCamera, UpdateCamera, 0, FinalizeCamera)
|
||||||
|
@ -125,7 +125,6 @@ IOSCamera g_Camera;
|
|||||||
didDropSampleBuffer:(CMSampleBufferRef)sampleBuffer
|
didDropSampleBuffer:(CMSampleBufferRef)sampleBuffer
|
||||||
fromConnection:(AVCaptureConnection *)connection
|
fromConnection:(AVCaptureConnection *)connection
|
||||||
{
|
{
|
||||||
|
|
||||||
//NSLog(@"DROPPING FRAME!!!");
|
//NSLog(@"DROPPING FRAME!!!");
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -352,7 +351,7 @@ static CMVideoDimensions FlipCoords(AVCaptureVideoDataOutput* output, const CMVi
|
|||||||
|
|
||||||
@end
|
@end
|
||||||
|
|
||||||
int CameraPlatform_StartCapture(dmBuffer::HBuffer* buffer, CameraType type, CaptureQuality quality, CameraInfo& outparams)
|
void CameraPlatform_StartCaptureAuthorized(dmBuffer::HBuffer* buffer, CameraType type, CaptureQuality quality, CameraInfo& outparams)
|
||||||
{
|
{
|
||||||
if(g_Camera.m_Delegate == 0)
|
if(g_Camera.m_Delegate == 0)
|
||||||
{
|
{
|
||||||
@ -381,10 +380,57 @@ int CameraPlatform_StartCapture(dmBuffer::HBuffer* buffer, CameraType type, Capt
|
|||||||
|
|
||||||
g_Camera.m_VideoBuffer = *buffer;
|
g_Camera.m_VideoBuffer = *buffer;
|
||||||
|
|
||||||
return started ? 1 : 0;
|
if (started)
|
||||||
|
{
|
||||||
|
Camera_QueueMessage(STATUS_STARTED);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
Camera_QueueMessage(STATUS_ERROR);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
int CameraPlatform_StopCapture()
|
void CameraPlatform_StartCapture(dmBuffer::HBuffer* buffer, CameraType type, CaptureQuality quality, CameraInfo& outparams)
|
||||||
|
{
|
||||||
|
// Request permission to access the camera.
|
||||||
|
int status = [AVCaptureDevice authorizationStatusForMediaType:AVMediaTypeVideo];
|
||||||
|
if (status == AVAuthorizationStatusAuthorized)
|
||||||
|
{
|
||||||
|
// The user has previously granted access to the camera.
|
||||||
|
dmLogInfo("AVAuthorizationStatusAuthorized");
|
||||||
|
CameraPlatform_StartCaptureAuthorized(buffer, type, quality, outparams);
|
||||||
|
}
|
||||||
|
else if (status == AVAuthorizationStatusNotDetermined)
|
||||||
|
{
|
||||||
|
dmLogInfo("AVAuthorizationStatusNotDetermined");
|
||||||
|
// The app hasn't yet asked the user for camera access.
|
||||||
|
[AVCaptureDevice requestAccessForMediaType:AVMediaTypeVideo completionHandler:^(BOOL granted) {
|
||||||
|
if (granted) {
|
||||||
|
dmLogInfo("AVAuthorizationStatusNotDetermined - granted!");
|
||||||
|
CameraPlatform_StartCaptureAuthorized(buffer, type, quality, outparams);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
dmLogInfo("AVAuthorizationStatusNotDetermined - not granted!");
|
||||||
|
Camera_QueueMessage(STATUS_NOT_PERMITTED);
|
||||||
|
}
|
||||||
|
}];
|
||||||
|
}
|
||||||
|
else if (status == AVAuthorizationStatusDenied)
|
||||||
|
{
|
||||||
|
// The user has previously denied access.
|
||||||
|
dmLogInfo("AVAuthorizationStatusDenied");
|
||||||
|
Camera_QueueMessage(STATUS_NOT_PERMITTED);
|
||||||
|
}
|
||||||
|
else if (status == AVAuthorizationStatusRestricted)
|
||||||
|
{
|
||||||
|
// The user can't grant access due to restrictions.
|
||||||
|
dmLogInfo("AVAuthorizationStatusRestricted");
|
||||||
|
Camera_QueueMessage(STATUS_NOT_PERMITTED);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void CameraPlatform_StopCapture()
|
||||||
{
|
{
|
||||||
if(g_Camera.m_Delegate != 0)
|
if(g_Camera.m_Delegate != 0)
|
||||||
{
|
{
|
||||||
@ -395,7 +441,6 @@ int CameraPlatform_StopCapture()
|
|||||||
dmBuffer::Destroy(g_Camera.m_VideoBuffer);
|
dmBuffer::Destroy(g_Camera.m_VideoBuffer);
|
||||||
g_Camera.m_VideoBuffer = 0;
|
g_Camera.m_VideoBuffer = 0;
|
||||||
}
|
}
|
||||||
return 1;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif // DM_PLATFORM_IOS/DM_PLATFORM_OSX
|
#endif // DM_PLATFORM_IOS/DM_PLATFORM_OSX
|
||||||
|
@ -22,5 +22,15 @@ struct CameraInfo
|
|||||||
CameraType m_Type;
|
CameraType m_Type;
|
||||||
};
|
};
|
||||||
|
|
||||||
extern int CameraPlatform_StartCapture(dmBuffer::HBuffer* buffer, CameraType type, CaptureQuality quality, CameraInfo& outparams);
|
enum CameraStatus
|
||||||
extern int CameraPlatform_StopCapture();
|
{
|
||||||
|
STATUS_STARTED,
|
||||||
|
STATUS_STOPPED,
|
||||||
|
STATUS_NOT_PERMITTED,
|
||||||
|
STATUS_ERROR
|
||||||
|
};
|
||||||
|
|
||||||
|
extern void CameraPlatform_StartCapture(dmBuffer::HBuffer* buffer, CameraType type, CaptureQuality quality, CameraInfo& outparams);
|
||||||
|
extern void CameraPlatform_StopCapture();
|
||||||
|
|
||||||
|
void Camera_QueueMessage(CameraStatus message);
|
||||||
|
@ -26,6 +26,7 @@ package = com.defold.camera
|
|||||||
|
|
||||||
[osx]
|
[osx]
|
||||||
bundle_identifier = com.defold.camera
|
bundle_identifier = com.defold.camera
|
||||||
|
infoplist = /Info.plist
|
||||||
|
|
||||||
[library]
|
[library]
|
||||||
include_dirs = camera
|
include_dirs = camera
|
||||||
|
@ -12,38 +12,34 @@ end
|
|||||||
|
|
||||||
|
|
||||||
local function start_capture(self)
|
local function start_capture(self)
|
||||||
if self.cameraframe ~= nil then
|
if not camera then
|
||||||
|
label.set_text("logo#status", "Capture Status: UNAVAILABLE")
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
|
|
||||||
if camera ~= nil then
|
local sysinfo = sys.get_sys_info()
|
||||||
|
|
||||||
local sysinfo = sys.get_sys_info()
|
local quality = camera.CAPTURE_QUALITY_HIGH
|
||||||
|
local type = camera.CAMERA_TYPE_FRONT
|
||||||
|
if sysinfo.system_name == 'iPhone OS' then
|
||||||
|
type = camera.CAMERA_TYPE_BACK
|
||||||
|
quality = camera.CAPTURE_QUALITY_MEDIUM
|
||||||
|
end
|
||||||
|
|
||||||
local quality = camera.CAPTURE_QUALITY_HIGH
|
camera.start_capture(type, quality, function(self, status)
|
||||||
local type = camera.CAMERA_TYPE_FRONT
|
if status == camera.STATUS_STARTED then
|
||||||
if sysinfo.system_name == 'iPhone OS' then
|
|
||||||
type = camera.CAMERA_TYPE_BACK
|
|
||||||
quality = camera.CAPTURE_QUALITY_MEDIUM
|
|
||||||
end
|
|
||||||
|
|
||||||
if camera.start_capture(type, quality) then
|
|
||||||
self.cameraframe = camera.get_frame()
|
self.cameraframe = camera.get_frame()
|
||||||
self.camerainfo = camera.get_info()
|
self.camerainfo = camera.get_info()
|
||||||
print("Initialized camera")
|
|
||||||
pprint(self.camerainfo)
|
|
||||||
|
|
||||||
self.cameratextureheader = {width=self.camerainfo.width,
|
self.cameratextureheader = {width=self.camerainfo.width,
|
||||||
height=self.camerainfo.height,
|
height=self.camerainfo.height,
|
||||||
type=resource.TEXTURE_TYPE_2D,
|
type=resource.TEXTURE_TYPE_2D,
|
||||||
format=resource.TEXTURE_FORMAT_RGB,
|
format=resource.TEXTURE_FORMAT_RGB,
|
||||||
num_mip_maps=1 }
|
num_mip_maps=1 }
|
||||||
|
else
|
||||||
|
label.set_text("logo#status", "Capture Status: ERROR")
|
||||||
end
|
end
|
||||||
label.set_text("logo#status", "Capture Status: ON")
|
end)
|
||||||
else
|
label.set_text("logo#status", "Capture Status: ON")
|
||||||
print("could not start camera capture")
|
|
||||||
label.set_text("logo#status", "Capture Status: UNAVAILABLE")
|
|
||||||
end
|
|
||||||
end
|
end
|
||||||
|
|
||||||
function init(self)
|
function init(self)
|
||||||
@ -73,16 +69,15 @@ function update(self, dt)
|
|||||||
local pathmodelcamera = go.get("#sprite", "texture0")
|
local pathmodelcamera = go.get("#sprite", "texture0")
|
||||||
resource.set_texture(pathmodelcamera, self.cameratextureheader, self.cameraframe)
|
resource.set_texture(pathmodelcamera, self.cameratextureheader, self.cameraframe)
|
||||||
end
|
end
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
function on_input(self, action_id, action)
|
function on_input(self, action_id, action)
|
||||||
if (action_id == hash("space") or action_id == hash("touch")) and action.pressed then
|
--[[if (action_id == hash("space") or action_id == hash("touch")) and action.pressed then
|
||||||
if self.cameraframe == nil then
|
if self.cameraframe == nil then
|
||||||
start_capture(self)
|
start_capture(self)
|
||||||
else
|
else
|
||||||
stop_capture(self)
|
stop_capture(self)
|
||||||
end
|
end
|
||||||
end
|
end--]]
|
||||||
end
|
end
|
||||||
|
Loading…
x
Reference in New Issue
Block a user