starling-framework
Version:
A fast, productive library for 2D cross-platform development.
44 lines • 1.72 kB
TypeScript
import MeshStyle from "./MeshStyle";
import VertexDataFormat from "../rendering/VertexDataFormat";
import RenderState from "../rendering/RenderState";
import MeshEffect from "../rendering/MeshEffect";
import Matrix from "openfl/geom/Matrix";
declare namespace starling.styles {
/**
* Provides a way to batch up to 5 (baseline profiles) or 16 different textures in one draw call, at the cost of more complex custom Fragment Shaders
* To use this, set Mesh.defaultStyle to MultiTextureStyle (ideally before Starling is initialised!)
*
*/
export class MultiTextureStyle extends MeshStyle {
constructor();
/**
* Maximum number of textures that can be batched.
* Default value is 5 (which is the absolute max with baseline profile)
* until <code>MultiTextureStyle.init()</code> has been called with Starling started
* You can call it manually if you want/need, otherwise it will be called by the
* first MultiTextureStyle instance created.
*
*/
static get MAX_NUM_TEXTURES(): number;
/**
* Maximum number of textures to be batched, default 2.
*
*/
static get maxTextures(): number;
static set maxTextures(value: number)
static init(): void;
/**
* @private
*/
override copyFrom(meshStyle: MeshStyle): void;
/**
* @private
*/
override createEffect(): MeshEffect;
override updateEffect(effect: MeshEffect, state: RenderState): void;
override canBatchWith(meshStyle: MeshStyle): boolean;
override batchVertexData(targetStyle: MeshStyle, targetVertexID?: number, matrix?: Matrix, vertexID?: number, numVertices?: number): void;
get numTextures(): number;
}
}
export default starling.styles.MultiTextureStyle;