import { AnimationManager } from '../core/animation_manager.js'; import { EventManager } from '../core/event_manager.js'; import { Rectangle } from '../geom/rectangle.js'; import { DisplayObject } from './display_object.js'; import { Texture } from './webgl/texture.js'; import type { Game } from '../core/game.js'; import { Frame } from '../core/frame.js'; import type { Matrix } from '../geom/matrix.js'; import type { RenderSession } from './render_session.js'; import type { AbstractFilter } from './webgl/abstract_filter.js'; export declare class Image extends DisplayObject { key: string | number | Texture | null; texture: Texture; _width: number; _height: number; tint: number; cachedTint: number; tilingTexture: Texture | null; tintedTexture: HTMLCanvasElement | null; blendMode: number; shader: AbstractFilter | null; _frame: Frame | Rectangle | null; pendingDestroy: boolean; events: EventManager; animations: AnimationManager; customRender: boolean; cropRect: Rectangle | null; _crop: Rectangle | null; refreshTexture: boolean; renderOrderID: number; /** * Creates a new Image instance. * @param {Game} game - The game instance this image belongs to. * @param {number} x - The x position of the image. * @param {number} y - The y position of the image. * @param {string | number | Texture} key - The texture key or texture to use. * @param {string | number} frame - The frame identifier (name or index) to use. */ constructor(game: Game, x: number, y: number, key: string | number | Texture | null, frame?: string | number | null); /** * Destroys this image and cleans up resources. */ destroy(): void; /** * Called before the update cycle for this image. */ preUpdate(): void; /** * Loads a texture for this image. * @param {string | number | Texture} key - The texture key or texture to use. * @param {string | number | null | undefined} frame - The frame identifier (name or index) to use. * @param {boolean} stopAnimation - Whether to stop the animation when changing textures. */ loadTexture(key: string | number | Texture | null, frame?: string | number | null, stopAnimation?: boolean): void; /** * Sets the current frame of this image. * @param {Frame} frame - The frame to set. */ setFrame(frame: Frame | Rectangle): void; /** * Resizes the frame of this image. * @param {DisplayObject} _parent - The parent display object. * @param {number} width - The new width of the frame. * @param {number} height - The new height of the frame. */ resizeFrame(_parent: DisplayObject, width: number, height: number): void; /** * Resets the frame of this image to its original frame. */ resetFrame(): void; /** * Gets the current frame index of this image. * @returns {number} The current frame index. */ get frame(): number; /** * Sets the current frame index of this image. * @param {number} value - The new frame index to set. */ set frame(value: number); /** * Gets the current frame name of this image. * @returns {string} The current frame name. */ get frameName(): string | null; /** * Sets the current frame name of this image. * @param {string} value - The new frame name to set. */ set frameName(value: string | null); /** * Crops the texture of this image. * @param {Rectangle} rect - The rectangle to crop to. * @param {boolean} copy - Whether to copy the rect or use it directly. */ crop(rect: Rectangle, copy?: boolean): void; /** * Updates the crop rectangle of this image. */ updateCrop(): void; /** * Gets the width of this image. * @returns {number} The width in pixels. */ get width(): number; /** * Sets the width of this image. * @param {number} value - The new width in pixels. */ set width(value: number); /** * Gets the height of this image. * @returns {number} The height in pixels. */ get height(): number; /** * Sets the height of this image. * @param {number} value - The new height in pixels. */ set height(value: number); /** * Called when the texture of this image is updated. */ onTextureUpdate(): void; /** * Sets the texture for this image. * @param {Texture} texture - The new texture to set. * @param {boolean} destroyBase - Whether to destroy the base texture. */ setTexture(texture: Texture, destroyBase?: boolean): void; /** * Gets the bounds of this image. * @param {Matrix} matrix - The transformation matrix to use. * @returns {Rectangle} The bounds rectangle of this image. */ getBounds(matrix?: Matrix | null): Rectangle; /** * Gets the local bounds of this image. * @returns {Rectangle} The local bounds rectangle of this image. */ getLocalBounds(): Rectangle; /** * Renders this image using WebGL. * @param {object} renderSession - The WebGL rendering session. * @param {Matrix} matrix - The transformation matrix to use. */ renderWebGL(renderSession: RenderSession, matrix?: Matrix | null): void; /** * Renders this image using Canvas. * @param {object} renderSession - The Canvas rendering session. * @param {Matrix} matrix - The transformation matrix to use. */ renderCanvas(renderSession: RenderSession, matrix?: Matrix | null): void; } //# sourceMappingURL=image.d.ts.map