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.

// @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;
interface RectCropTextureProvider {
    cropRect: Rect;
    inputTexture: Texture;
    rotation: number;
    getAspect(): number;
    getHeight(): number;
    getLoadStatus(): LoadStatus;
    getTypeName(): string;
    getWidth(): number;
    isOfType(type: string): boolean;
    isSame(other: ScriptObject): boolean;
}

Hierarchy (view full)

Properties

cropRect: Rect

The cropped region to draw.

inputTexture: Texture

Input texture to crop.

rotation: number

Angle, in radians, the cropped region is rotated by.

Methods

  • Returns the texture's aspect ratio, which is calculated as width / height.

    Returns number

  • Returns true if the object matches or derives from the passed in type.

    Parameters

    • type: string

    Returns boolean

  • Returns true if this object is the same as other. Useful for checking if two references point to the same thing.

    Parameters

    Returns boolean