RectCropTextureProvider
Lens Studio v3.0+
Inherits from CropTextureProvider
Description
Texture Provider providing a cropped region of the input texture. The region is specified by the cropRect in local space and rotation. Can be accessed using Texture.control on a RectCropTexture asset, such as a Screen Crop Texture. For more information, see the Crop Textures guide.
Properties
cropRect
: Rect
The cropped region to draw.
rotation
: Number
Angle, in radians, the cropped region is rotated by.
Inherited Methods
getAspect()
: Number
Returns the texture’s aspect ratio, which is calculated as width / height.
getHeight()
: Number
Returns the height of the texture in pixels.
getWidth()
: Number
Returns the width of the texture in pixels.
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.
Inherited Properties
inputTexture
: Texture
Input texture to crop.
Examples
// @input Asset.Texture screenCropTexture
// Zoom in
script.screenCropTexture.control.cropRect = Rect.create(-.5, .5, -.5, .5);
// Rotate by 90 degrees
script.screenCropTexture.control.rotation = Math.PI * .5;
Still Looking for help?
Visit Support