texture
On this page

texture()

Function in Runtime

A texture of the block's default device: using _ = device.use() names the device, and the texture is the one device.texture(options) makes.

import { texture } from 'typeshade/runtime'

The signature, the description and the examples come from the compiler's own source at commit af54ddad5.

Syntax

function texture(options: {
readonly size: readonly [number, number];
readonly format: string;
readonly storage?: boolean;
}): Texture

Parameters

options { readonly size: readonly [number, number]; readonly format: string; readonly storage?: boolean; }

size and format, as device.texture() takes them.

Return value

Texture

the device’s texture.

Exceptions

TypeError

TypeError when no device is in use, and as device.texture() throws.

Description

A texture lives on its device only, so it takes no range of the region (R17).

In the guide

See also

Source

src/runtime/resource.ts, line 1129, at commit af54ddad5

Edit this page Report a problem