blaze-2d
Version:
A fast and simple WebGL 2 2D game engine written in TypeScript
20 lines (19 loc) • 759 B
TypeScript
/**
* Stores information about a tilesheet that can be used to texture chunks in a {@link ChunkController}.
*/
export default class Tilesheet {
texture: WebGLTexture;
numOfTiles: number;
tileSize: number;
width: number;
height: number;
/**
* Creates a {@link Tilesheet} instance and creates a {@link WebGLTexture} from the given image path.
*
* @param gl The webgl context to use when creating the {@link WebGLTexture}
* @param path The path to the tilesheet image
* @param tileSize The size of each individual tile in the tilesheet in px
* @param numOfTiles The number of tiles in the tilesheet
*/
constructor(gl: WebGL2RenderingContext, path: string, tileSize: number, numOfTiles: number);
}