Difference between revisions of "Camera"
From GiderosMobile
Line 2: | Line 2: | ||
'''Supported platforms:''' android, ios, mac, pc<br/> | '''Supported platforms:''' android, ios, mac, pc<br/> | ||
'''Available since:''' Gideros 2017.8<br/> | '''Available since:''' Gideros 2017.8<br/> | ||
− | === Description === | + | === <translate>Description</translate> === |
<translate>Renders live camera stream into a Texture</translate> | <translate>Renders live camera stream into a Texture</translate> | ||
− | === Examples === | + | === <translate>Examples</translate> === |
'''Example'''<br/> | '''Example'''<br/> | ||
<source lang="lua">require "camera" | <source lang="lua">require "camera" | ||
Line 23: | Line 23: | ||
{|- | {|- | ||
| style="width: 50%; vertical-align:top;"| | | style="width: 50%; vertical-align:top;"| | ||
− | === Methods === | + | === <translate>Methods</translate> === |
[[Special:MyLanguage/camera.availableDevices|camera.availableDevices]] ''<translate>Return a list of available devices.</translate>''<br/> | [[Special:MyLanguage/camera.availableDevices|camera.availableDevices]] ''<translate>Return a list of available devices.</translate>''<br/> | ||
[[Special:MyLanguage/camera.start|camera.start]] ''<translate>Start streaming camera pictures to a Texture</translate>''<br/> | [[Special:MyLanguage/camera.start|camera.start]] ''<translate>Start streaming camera pictures to a Texture</translate>''<br/> | ||
[[Special:MyLanguage/camera.stop|camera.stop]] ''<translate>Stop camera streaming.</translate>''<br/> | [[Special:MyLanguage/camera.stop|camera.stop]] ''<translate>Stop camera streaming.</translate>''<br/> | ||
| style="width: 50%; vertical-align:top;"| | | style="width: 50%; vertical-align:top;"| | ||
− | === Events === | + | === <translate>Events</translate> === |
− | === Constants === | + | === <translate>Constants</translate> === |
|} | |} |
Revision as of 07:28, 24 August 2018
Supported platforms: android, ios, mac, pc
Available since: Gideros 2017.8
Description
Renders live camera stream into a Texture
Examples
Example
require "camera"
-- Probe camera size (use a dummy 512x512 surface)
Camera.texture=Texture.new(nil,512,512)
cw,ch=Camera.start(Camera.texture)
Camera.stop()
-- Restart camera with a full sized texture
Camera.texture=Texture.new(nil,cw,ch,true)
cw,ch=Camera.start(Camera.texture)
application:setLogicalDimensions(ch,cw)
local b=Bitmap.new(Camera.texture)
stage:addChild(b)
Methodscamera.availableDevices Return a list of available devices. |
EventsConstants |