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
Name | Type | Description |
---|---|---|
gl | WebGL2RenderingContext | The webgl context to use when creating the {@link WebGLTexture} |
path | string | The path to the tilesheet image |
tileSize | number | The size of each individual tile in the tilesheet in px |
numOfTiles | number | The 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