ScriptScene
Lens Studio v1.0.0+
Inherits from ScriptObject
Description
Represents the Lens scene. Accessible through global.scene
.
Methods
createRenderTargetTexture()
: Texture
Creates a new Render Target texture with a RenderTargetProvider as its control
property.
createSceneObject(String name)
: SceneObject
Adds a new SceneObject named name
to the scene.
getCameraType()
: String
Returns a string describing the currently active device camera.
Returns “back” if the rear-facing (aka World) camera is active.
Returns “front” if the front-facing (aka Selfie) camera is active.
Otherwise, the camera is not initialized.
getRootObject(Number index)
: SceneObject
Returns the root SceneObject at index index
in the current scene.
getRootObjectsCount()
: Number
Returns the number of SceneObjects in the current scene.
isRecording()
: Boolean
Returns whether or not the scene is currently being recorded.
Inherited Methods
getTypeName()
: String
Returns the name of this object’s type.
isOfType(String type)
: Boolean
Returns true if the object matches or derives from the passed in type.
Examples
if(global.scene.getCameraType() == "front")
{
print("the front camera is active");
}
else if(global.scene.getCameraType() == "back")
{
print("the back camera is active");
}
var newObject = global.scene.createSceneObject("newObject");
Still Looking for help?
Visit Support