Provide { type: "texture" }
to get a texture instead of a data url.
The texture of the screenshot. Returns null if the screenshot could not be taken.
Take a screenshot from the current scene.
The data url of the screenshot. Returns null if the screenshot could not be taken.
const res = screenshot2({
width: 1024,
height: 1024,
mimeType: "image/webp",
transparent: true,
})
// use saveImage to download the image
saveImage(res, "screenshot.webp");
Take a screenshot from the current scene and return a Texture. This can applied to a surface in 3D space.
Provide { type: "texture" }
to get a texture instead of a data url.
The texture of the screenshot. Returns null if the screenshot could not be taken.
Take a screenshot from the current scene and return a Texture. This can applied to a surface in 3D space.