Skip to main content

Class: Tilesheet

tilesheet.Tilesheet

Stores information about a tilesheet that can be used to texture chunks in a {@link ChunkController}.

Constructors

constructor

โ€ข new Tilesheet(gl, path, tileSize, numOfTiles)

Creates a Tilesheet instance and creates a {@link WebGLTexture} from the given image path.

Parameters

NameTypeDescription
glWebGL2RenderingContextThe webgl context to use when creating the {@link WebGLTexture}
pathstringThe path to the tilesheet image
tileSizenumberThe size of each individual tile in the tilesheet in px
numOfTilesnumberThe number of tiles in the tilesheet

Defined in

src/tilesheet.ts:21

Properties

height

โ€ข height: number

Defined in

src/tilesheet.ts:11


numOfTiles

โ€ข numOfTiles: number

Defined in

src/tilesheet.ts:8


texture

โ€ข texture: WebGLTexture

Defined in

src/tilesheet.ts:7


tileSize

โ€ข tileSize: number

Defined in

src/tilesheet.ts:9


width

โ€ข width: number

Defined in

src/tilesheet.ts:10