/** * A TextureAtlas contains a number of frames from a texture. Each frame defines a region in a * texture. The TextureAtlas is referenced by {@link Sprite}s. * * @category Graphics */ export class TextureAtlas extends EventHandler { /** * @type {import('../platform/graphics/texture.js').Texture} * @private */ private _texture; /** * @type {object} * @private */ private _frames; /** * Sets the texture used by the atlas. * * @type {import('../platform/graphics/texture.js').Texture} */ set texture(value: import("../platform/graphics/texture.js").Texture); /** * Gets the texture used by the atlas. * * @type {import('../platform/graphics/texture.js').Texture} */ get texture(): import("../platform/graphics/texture.js").Texture; /** * Sets the frames which define portions of the texture atlas. * * @type {object} */ set frames(value: object); /** * Gets the frames which define portions of the texture atlas. * * @type {object} */ get frames(): object; /** * Set a new frame in the texture atlas. * * @param {string} key - The key of the frame. * @param {object} data - The properties of the frame. * @param {import('../core/math/vec4.js').Vec4} data.rect - The u, v, width, height properties * of the frame in pixels. * @param {import('../core/math/vec2.js').Vec2} data.pivot - The pivot of the frame - values * are between 0-1. * @param {import('../core/math/vec4.js').Vec4} data.border - The border of the frame for * 9-slicing. Values are ordered as follows: left, bottom, right, top border in pixels. * @example * atlas.setFrame('1', { * rect: new pc.Vec4(0, 0, 128, 128), * pivot: new pc.Vec2(0.5, 0.5), * border: new pc.Vec4(5, 5, 5, 5) * }); */ setFrame(key: string, data: { rect: import("../core/math/vec4.js").Vec4; pivot: import("../core/math/vec2.js").Vec2; border: import("../core/math/vec4.js").Vec4; }): void; /** * Removes a frame from the texture atlas. * * @param {string} key - The key of the frame. * @example * atlas.removeFrame('1'); */ removeFrame(key: string): void; /** * Free up the underlying texture owned by the atlas. */ destroy(): void; } import { EventHandler } from '../core/event-handler.js';