UNPKG

@woosh/meep-engine

Version:

Pure JavaScript game engine. Fully featured and production ready.

98 lines 2.57 kB
export class AtlasPatch { /** * Position in the atlas where the raw patch data is found, excludes padding * @readonly * @type {Vector2} */ readonly position: Vector2; /** * Size in pixels of the patch, excludes padding * @readonly * @type {Vector2} */ readonly size: Vector2; /** * Number of pixels to add to patch size to avoid sampling error at the edges * @type {number} */ padding: number; /** * Managed by TextureAtlas * @type {number} */ id: number; /** * Texture data of the patch, this is what will be stenciled into the atlas * @type {Sampler2D|null} */ sampler: Sampler2D | null; /** * @readonly * @type {Rectangle} */ readonly uv: Rectangle; /** * Area in the atlas where patch along with the padding is packed into. * Used for packing inside TextureAtlas. * Do not modify manually * @readonly * @type {AABB2} */ readonly packing: AABB2; /** * bitfield * @type {number|AtlasPatchFlag} */ flags: number | AtlasPatchFlag; /** * Version of associated sampler that was last written. * Used to track and signal when sampler needs to be re-painted. * @type {number} */ last_painted_version: number; /** * * @param {number} canvasWidth * @param {number} canvasHeight */ updateUV(canvasWidth: number, canvasHeight: number): void; /** * * @param {number} canvasWidth * @param {number} canvasHeight */ updatePositionFromPacking(canvasWidth: number, canvasHeight: number): void; /** * * @param {number|AtlasPatchFlag} flag * @returns {void} */ setFlag(flag: number | AtlasPatchFlag): void; /** * * @param {number|AtlasPatchFlag} flag * @returns {void} */ clearFlag(flag: number | AtlasPatchFlag): void; /** * * @param {number|AtlasPatchFlag} flag * @param {boolean} value */ writeFlag(flag: number | AtlasPatchFlag, value: boolean): void; /** * * @param {number|AtlasPatchFlag} flag * @returns {boolean} */ getFlag(flag: number | AtlasPatchFlag): boolean; /** * @readonly * @type {boolean} */ readonly isAtlasPatch: boolean; } import Vector2 from "../../../../core/geom/Vector2.js"; import Rectangle from "../../../../core/geom/2d/Rectangle.js"; import AABB2 from "../../../../core/geom/2d/aabb/AABB2.js"; //# sourceMappingURL=AtlasPatch.d.ts.map