Texture
ClassRepresents a texture file asset.
- Available on all platforms
Index
Properties
Methods
Example
// Print the texture's height, width
// Change the texture's name and print it out
//@input Asset.Texture texture
print("Width = " + script.texture.getWidth().toString());
print("Height = " + script.texture.getHeight().toString());
// Takes a screenshot of device camera input and applies it to meshVisual
//@input Asset.Texture deviceCameraTexture
//@input Component.MeshVisual meshVisual
var textureCopy = script.deviceCameraTexture.copyFrame();
script.meshVisual.mainPass.baseTex = textureCopy;
Extends
Properties
control
control:
TextureProvider
The TextureProvider for the texture, which may control things like animation depending on the texture type. See also: AnimatedTextureFileProvider.
Default Value
null
name
name:
string
The name of the Asset in Lens Studio.
Default Value
""
Inherited from
uniqueIdentifier
readonlyuniqueIdentifier:string
Since
Lens Scripting Version 176
Inherited from
Methods
copyFrame()
copyFrame():
Texture
Returns a Texture that captures the current state of this Texture Asset.
Returns
Texture
createMarkerAsset()
createMarkerAsset():
MarkerAsset
Creates a marker asset from the texture.
Returns
Since
Lens Scripting Version 240
getFormat()
getFormat():
TextureFormat
Returns
Since
Lens Scripting Version 315
getHeight()
getHeight():
number
Returns the height of the texture.
Returns
number
getTypeName()
staticgetTypeName():TypeName<Texture>
Returns the fully-qualified JavaScript type name for this class (for example, "Component.Camera"). This is a static accessor (no instance required) and returns the same value as the instance getTypeName().
Returns
TypeName<Texture>
Overrides
getTypeName()
getTypeName():
string
Returns the name of this object's type.
Returns
string
Inherited from
getWidth()
getWidth():
number
Returns the width of the texture.
Returns
number
isOfType()
isOfType(
type):boolean
Returns true if the object matches or derives from the passed in type.
Parameters
| Parameter | Type |
|---|---|
type | string |
Returns
boolean
Inherited from
isSame()
isSame(
other):boolean
Returns true if this object is the same as other. Useful for checking if two references point to the same thing.
Parameters
| Parameter | Type |
|---|---|
other | ScriptObject |
Returns
boolean