• Take a screenshot from the current scene.
    NOTE: Use screenshot2 for more options.

    Parameters

    • Optional context: Context

      The context to take the screenshot from

    • Optional width: number

      The width of the screenshot

    • Optional height: number

      The height of the screenshot

    • mimeType: ScreenshotImageMimeType = "image/webp"

      The mime type of the image

    • Optional camera: Camera

      The camera to use for the screenshot

    Returns string | null

    The data url of the screenshot. Returns null if the screenshot could not be taken.

    Example

    const dataUrl = screenshot();
    saveImage(dataUrl, "screenshot.png");

Generated using TypeDoc