Difference between revisions of "Camera"
From GiderosMobile
m (Text replacement - "<source" to "<syntaxhighlight") |
m (Text replacement - "</source>" to "</syntaxhighlight>") |
||
Line 8: | Line 8: | ||
<syntaxhighlight lang="lua"> | <syntaxhighlight lang="lua"> | ||
require "camera" | require "camera" | ||
− | </ | + | </syntaxhighlight> |
=== Example === | === Example === | ||
Line 27: | Line 27: | ||
local b=Bitmap.new(Camera.texture) | local b=Bitmap.new(Camera.texture) | ||
stage:addChild(b) | stage:addChild(b) | ||
− | </ | + | </syntaxhighlight> |
{|- | {|- |
Latest revision as of 14:27, 13 July 2023
Supported platforms:
Available since: Gideros 2017.8
Description
Renders live camera stream into a Texture.
require "camera"
Example
require "camera"
-- Probe camera size (use a dummy 512x512 surface)
Camera.texture=RenderTargert.new(512,512)
cw,ch=Camera.start(Camera.texture)
Camera.stop()
-- Restart camera with a full sized texture
Camera.texture=RenderTarget.new(cw,ch,true)
cw,ch=Camera.start(Camera.texture)
application:setLogicalDimensions(ch,cw)
local b=Bitmap.new(Camera.texture)
stage:addChild(b)
Methodscamera.availableDevices returns a list of available devices |
EventsConstants |