Difference between revisions of "Camera"
m (Text replacement - "<source" to "<syntaxhighlight") |
|||
Line 6: | Line 6: | ||
=== Description === | === Description === | ||
Renders live camera stream into a Texture. | Renders live camera stream into a Texture. | ||
− | < | + | <syntaxhighlight lang="lua"> |
require "camera" | require "camera" | ||
</source> | </source> | ||
=== Example === | === Example === | ||
− | < | + | <syntaxhighlight lang="lua"> |
require "camera" | require "camera" | ||
Revision as of 14:26, 13 July 2023
Supported platforms:
Available since: Gideros 2017.8
Description
Renders live camera stream into a Texture. <syntaxhighlight lang="lua"> require "camera" </source>
Example
<syntaxhighlight lang="lua"> 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) </source>
Methodscamera.availableDevices returns a list of available devices |
EventsConstants |