excalibur
Version:
Excalibur.js is a simple JavaScript game engine with TypeScript bindings for making 2D games in HTML5 Canvas. Our mission is to make web game development as simple as possible.
49 lines (48 loc) • 1.58 kB
TypeScript
import { HTMLImageSource } from '../ExcaliburGraphicsContext';
import { ExcaliburGraphicsContextWebGL } from '../ExcaliburGraphicsContextWebGL';
import { RendererPlugin } from '../renderer';
export interface ImageRendererOptions {
pixelArtSampler: boolean;
uvPadding: number;
}
export declare class ImageRendererV2 implements RendererPlugin {
readonly type = "ex.image-v2";
priority: number;
readonly pixelArtSampler: boolean;
readonly uvPadding: number;
private _maxImages;
private _maxTextures;
private _components;
private _context;
private _gl;
private _shader;
private _transformData;
private _imageCount;
private _textures;
private _textureIndex;
private _textureToIndex;
private _images;
private _vertexIndex;
private _quadMesh;
private _meshBuffer;
private _vao;
constructor(options: ImageRendererOptions);
initialize(gl: WebGL2RenderingContext, context: ExcaliburGraphicsContextWebGL): void;
private _bindData;
dispose(): void;
private _transformFragmentSource;
private _addImageAsTexture;
private _bindTextures;
private _getTextureIdForImage;
private _isFull;
private _imageToWidth;
private _getImageWidth;
private _imageToHeight;
private _getImageHeight;
private _view;
private _dest;
private _defaultTint;
draw(image: HTMLImageSource, sx: number, sy: number, swidth?: number, sheight?: number, dx?: number, dy?: number, dwidth?: number, dheight?: number): void;
hasPendingDraws(): boolean;
flush(): void;
}