UNPKG

pixi.js

Version:

<p align="center"> <a href="https://pixijs.com" target="_blank" rel="noopener noreferrer"> <img height="150" src="https://files.pixijs.download/branding/pixijs-logo-transparent-dark.svg?v=1" alt="PixiJS logo"> </a> </p> <br/> <p align="center">

1 lines 24.1 kB
{"version":3,"file":"Sprite.mjs","sources":["../../../src/scene/sprite/Sprite.ts"],"sourcesContent":["import { ObservablePoint } from '../../maths/point/ObservablePoint';\nimport { Texture } from '../../rendering/renderers/shared/texture/Texture';\nimport { updateQuadBounds } from '../../utils/data/updateQuadBounds';\nimport { deprecation } from '../../utils/logging/deprecation';\nimport { ViewContainer, type ViewContainerOptions } from '../view/ViewContainer';\nimport { type BatchableSprite } from './BatchableSprite';\n\nimport type { Size } from '../../maths/misc/Size';\nimport type { PointData } from '../../maths/point/PointData';\nimport type { TextureSourceLike } from '../../rendering/renderers/shared/texture/Texture';\nimport type { BoundsData } from '../container/bounds/Bounds';\nimport type { Optional } from '../container/container-mixins/measureMixin';\nimport type { DestroyOptions } from '../container/destroyTypes';\n\n/**\n * Options for configuring a Sprite instance. Defines the texture, anchor point, and rendering behavior.\n * @example\n * ```ts\n * // Create a basic sprite with texture\n * const sprite = new Sprite({\n * texture: Texture.from('sprite.png')\n * });\n *\n * // Create a centered sprite with rounded position\n * const centeredSprite = new Sprite({\n * texture: Texture.from('centered.png'),\n * anchor: 0.5, // Center point\n * roundPixels: true, // Crisp rendering\n * x: 100, // Position from ViewContainerOptions\n * y: 100\n * });\n *\n * // Create a sprite with specific anchor points\n * const anchoredSprite = new Sprite({\n * texture: Texture.from('corner.png'),\n * anchor: {\n * x: 1, // Right-aligned\n * y: 0 // Top-aligned\n * }\n * });\n * ```\n * @extends ViewContainerOptions\n * @category scene\n * @standard\n * @noInheritDoc\n */\nexport interface SpriteOptions extends PixiMixins.SpriteOptions, ViewContainerOptions\n{\n /**\n * The texture to use for the sprite. If not provided, uses Texture.EMPTY\n * @default Texture.EMPTY\n * @example\n * ```ts\n * // Create a sprite with a texture\n * const sprite = new Sprite({\n * texture: Texture.from('path/to/image.png')\n * });\n * // Update the texture later\n * sprite.texture = Texture.from('path/to/another-image.png');\n * ```\n */\n texture?: Texture;\n\n /**\n * The anchor point of the sprite (0-1 range).\n * Controls the origin point for rotation, scaling, and positioning.\n * Can be a number for uniform anchor or a PointData for separate x/y values.\n * @default 0\n * @example\n * ```ts\n * // Centered anchor\n * anchor: 0.5\n * // Separate x/y anchor\n * anchor: { x: 0.5, y: 0.5 }\n * // Right-aligned anchor\n * anchor: { x: 1, y: 0 }\n * ```\n */\n anchor?: PointData | number;\n\n /**\n * Whether or not to round the x/y position to whole pixels.\n * Useful for crisp pixel art style rendering.\n * @default false\n * @example\n * ```ts\n * const sprite = new Sprite({\n * texture: Texture.from('sprite.png'),\n * roundPixels: true // Ensures crisp rendering\n * });\n * ```\n */\n roundPixels?: boolean;\n}\n// eslint-disable-next-line requireExport/require-export-jsdoc, requireMemberAPI/require-member-api-doc\nexport interface Sprite extends PixiMixins.Sprite, ViewContainer<BatchableSprite> {}\n\n/**\n * The Sprite object is one of the most important objects in PixiJS. It is a\n * drawing item that can be added to a scene and rendered to the screen.\n * Sprites can display images, handle input events, and be transformed in various ways.\n * @example\n * ```ts\n * // Create a sprite directly from an image path\n * const sprite = Sprite.from('assets/image.png');\n * sprite.position.set(100, 100);\n * app.stage.addChild(sprite);\n *\n * // Create from a spritesheet (more efficient)\n * const sheet = await Assets.load('assets/spritesheet.json');\n * const sprite = new Sprite(sheet.textures['image.png']);\n *\n * // Create with specific options\n * const configuredSprite = new Sprite({\n * texture: Texture.from('sprite.png'),\n * anchor: 0.5, // Center anchor point\n * position: { x: 100, y: 100 },\n * scale: { x: 2, y: 2 }, // Double size\n * rotation: Math.PI / 4 // 45 degrees\n * });\n *\n * // Animate sprite properties\n * app.ticker.add(() => {\n * sprite.rotation += 0.1; // Rotate\n * sprite.scale.x = Math.sin(performance.now() / 1000) + 1; // Pulse scale\n * });\n * ```\n * @category scene\n * @standard\n * @see {@link SpriteOptions} For configuration options\n * @see {@link Texture} For texture management\n * @see {@link Assets} For asset loading\n */\nexport class Sprite extends ViewContainer<BatchableSprite>\n{\n /**\n * Creates a new sprite based on a source texture, image, video, or canvas element.\n * This is a convenience method that automatically creates and manages textures.\n * @example\n * ```ts\n * // Create from path or URL\n * const sprite = Sprite.from('assets/image.png');\n *\n * // Create from existing texture\n * const sprite = Sprite.from(texture);\n *\n * // Create from canvas\n * const canvas = document.createElement('canvas');\n * const sprite = Sprite.from(canvas, true); // Skip caching new texture\n * ```\n * @param source - The source to create the sprite from. Can be a path to an image, a texture,\n * or any valid texture source (canvas, video, etc.)\n * @param skipCache - Whether to skip adding to the texture cache when creating a new texture\n * @returns A new sprite based on the source\n * @see {@link Texture.from} For texture creation details\n * @see {@link Assets} For asset loading and management\n */\n public static from(source: Texture | TextureSourceLike, skipCache = false): Sprite\n {\n if (source instanceof Texture)\n {\n return new Sprite(source);\n }\n\n return new Sprite(Texture.from(source, skipCache));\n }\n\n /** @internal */\n public override readonly renderPipeId: string = 'sprite';\n\n /** @internal */\n public batched = true;\n /** @internal */\n public readonly _anchor: ObservablePoint;\n\n /** @internal */\n public _texture: Texture;\n\n private readonly _visualBounds: BoundsData = { minX: 0, maxX: 1, minY: 0, maxY: 0 };\n\n private _width: number;\n private _height: number;\n\n /**\n * @param options - The options for creating the sprite.\n */\n constructor(options: SpriteOptions | Texture = Texture.EMPTY)\n {\n if (options instanceof Texture)\n {\n options = { texture: options };\n }\n\n // split out\n const { texture = Texture.EMPTY, anchor, roundPixels, width, height, ...rest } = options;\n\n super({\n label: 'Sprite',\n ...rest\n });\n\n this._anchor = new ObservablePoint(\n {\n _onUpdate: () =>\n {\n this.onViewUpdate();\n }\n },\n );\n\n if (anchor)\n {\n this.anchor = anchor;\n }\n else if (texture.defaultAnchor)\n {\n this.anchor = texture.defaultAnchor;\n }\n\n this.texture = texture;\n\n this.allowChildren = false;\n this.roundPixels = roundPixels ?? false;\n\n // needs to be set after the container has initiated\n if (width !== undefined) this.width = width;\n if (height !== undefined) this.height = height;\n }\n\n set texture(value: Texture)\n {\n value ||= Texture.EMPTY;\n\n const currentTexture = this._texture;\n\n if (currentTexture === value) return;\n\n if (currentTexture && currentTexture.dynamic) currentTexture.off('update', this.onViewUpdate, this);\n if (value.dynamic) value.on('update', this.onViewUpdate, this);\n\n this._texture = value;\n\n if (this._width)\n {\n this._setWidth(this._width, this._texture.orig.width);\n }\n\n if (this._height)\n {\n this._setHeight(this._height, this._texture.orig.height);\n }\n\n this.onViewUpdate();\n }\n\n /**\n * The texture that is displayed by the sprite. When changed, automatically updates\n * the sprite dimensions and manages texture event listeners.\n * @example\n * ```ts\n * // Create sprite with texture\n * const sprite = new Sprite({\n * texture: Texture.from('sprite.png')\n * });\n *\n * // Update texture\n * sprite.texture = Texture.from('newSprite.png');\n *\n * // Use texture from spritesheet\n * const sheet = await Assets.load('spritesheet.json');\n * sprite.texture = sheet.textures['frame1.png'];\n *\n * // Reset to empty texture\n * sprite.texture = Texture.EMPTY;\n * ```\n * @see {@link Texture} For texture creation and management\n * @see {@link Assets} For asset loading\n */\n get texture()\n {\n return this._texture;\n }\n\n /**\n * The bounds of the sprite, taking into account the texture's trim area.\n * @example\n * ```ts\n * const texture = new Texture({\n * source: new TextureSource({ width: 300, height: 300 }),\n * frame: new Rectangle(196, 66, 58, 56),\n * trim: new Rectangle(4, 4, 58, 56),\n * orig: new Rectangle(0, 0, 64, 64),\n * rotate: 2,\n * });\n * const sprite = new Sprite(texture);\n * const visualBounds = sprite.visualBounds;\n * // console.log(visualBounds); // { minX: -4, maxX: 62, minY: -4, maxY: 60 }\n */\n get visualBounds()\n {\n updateQuadBounds(this._visualBounds, this._anchor, this._texture);\n\n return this._visualBounds;\n }\n\n /**\n * @deprecated\n * @ignore\n */\n get sourceBounds()\n {\n // #if _DEBUG\n deprecation('8.6.1', 'Sprite.sourceBounds is deprecated, use visualBounds instead.');\n // #endif\n\n return this.visualBounds;\n }\n\n /** @private */\n protected updateBounds()\n {\n const anchor = this._anchor;\n const texture = this._texture;\n\n const bounds = this._bounds;\n\n const { width, height } = texture.orig;\n\n bounds.minX = -anchor._x * width;\n bounds.maxX = bounds.minX + width;\n\n bounds.minY = -anchor._y * height;\n bounds.maxY = bounds.minY + height;\n }\n\n /**\n * Destroys this sprite renderable and optionally its texture.\n * @param options - Options parameter. A boolean will act as if all options\n * have been set to that value\n * @example\n * sprite.destroy();\n * sprite.destroy(true);\n * sprite.destroy({ texture: true, textureSource: true });\n */\n public override destroy(options: DestroyOptions = false)\n {\n super.destroy(options);\n\n const destroyTexture = typeof options === 'boolean' ? options : options?.texture;\n\n if (destroyTexture)\n {\n const destroyTextureSource = typeof options === 'boolean' ? options : options?.textureSource;\n\n this._texture.destroy(destroyTextureSource);\n }\n\n this._texture = null;\n (this._visualBounds as null) = null;\n (this._bounds as null) = null;\n (this._anchor as null) = null;\n this._gpuData = null;\n }\n\n /**\n * The anchor sets the origin point of the sprite. The default value is taken from the {@link Texture}\n * and passed to the constructor.\n *\n * - The default is `(0,0)`, this means the sprite's origin is the top left.\n * - Setting the anchor to `(0.5,0.5)` means the sprite's origin is centered.\n * - Setting the anchor to `(1,1)` would mean the sprite's origin point will be the bottom right corner.\n *\n * If you pass only single parameter, it will set both x and y to the same value as shown in the example below.\n * @example\n * ```ts\n * // Center the anchor point\n * sprite.anchor = 0.5; // Sets both x and y to 0.5\n * sprite.position.set(400, 300); // Sprite will be centered at this position\n *\n * // Set specific x/y anchor points\n * sprite.anchor = {\n * x: 1, // Right edge\n * y: 0 // Top edge\n * };\n *\n * // Using individual coordinates\n * sprite.anchor.set(0.5, 1); // Center-bottom\n *\n * // For rotation around center\n * sprite.anchor.set(0.5);\n * sprite.rotation = Math.PI / 4; // 45 degrees around center\n *\n * // For scaling from center\n * sprite.anchor.set(0.5);\n * sprite.scale.set(2); // Scales from center point\n * ```\n */\n get anchor(): ObservablePoint\n {\n return this._anchor;\n }\n\n set anchor(value: PointData | number)\n {\n typeof value === 'number' ? this._anchor.set(value) : this._anchor.copyFrom(value);\n }\n\n /**\n * The width of the sprite, setting this will actually modify the scale to achieve the value set.\n * @example\n * ```ts\n * // Set width directly\n * sprite.width = 200;\n * console.log(sprite.scale.x); // Scale adjusted to match width\n *\n * // Set width while preserving aspect ratio\n * const ratio = sprite.height / sprite.width;\n * sprite.width = 300;\n * sprite.height = 300 * ratio;\n *\n * // For better performance when setting both width and height\n * sprite.setSize(300, 400); // Avoids recalculating bounds twice\n *\n * // Reset to original texture size\n * sprite.width = sprite.texture.orig.width;\n * ```\n */\n override get width(): number\n {\n return Math.abs(this.scale.x) * this._texture.orig.width;\n }\n\n override set width(value: number)\n {\n this._setWidth(value, this._texture.orig.width);\n this._width = value;\n }\n\n /**\n * The height of the sprite, setting this will actually modify the scale to achieve the value set.\n * @example\n * ```ts\n * // Set height directly\n * sprite.height = 150;\n * console.log(sprite.scale.y); // Scale adjusted to match height\n *\n * // Set height while preserving aspect ratio\n * const ratio = sprite.width / sprite.height;\n * sprite.height = 200;\n * sprite.width = 200 * ratio;\n *\n * // For better performance when setting both width and height\n * sprite.setSize(300, 400); // Avoids recalculating bounds twice\n *\n * // Reset to original texture size\n * sprite.height = sprite.texture.orig.height;\n * ```\n */\n override get height(): number\n {\n return Math.abs(this.scale.y) * this._texture.orig.height;\n }\n\n override set height(value: number)\n {\n this._setHeight(value, this._texture.orig.height);\n this._height = value;\n }\n\n /**\n * Retrieves the size of the Sprite as a [Size]{@link Size} object based on the texture dimensions and scale.\n * This is faster than getting width and height separately as it only calculates the bounds once.\n * @example\n * ```ts\n * // Basic size retrieval\n * const sprite = new Sprite(Texture.from('sprite.png'));\n * const size = sprite.getSize();\n * console.log(`Size: ${size.width}x${size.height}`);\n *\n * // Reuse existing size object\n * const reuseSize = { width: 0, height: 0 };\n * sprite.getSize(reuseSize);\n * ```\n * @param out - Optional object to store the size in, to avoid allocating a new object\n * @returns The size of the Sprite\n * @see {@link Sprite#width} For getting just the width\n * @see {@link Sprite#height} For getting just the height\n * @see {@link Sprite#setSize} For setting both width and height\n */\n public override getSize(out?: Size): Size\n {\n out ||= {} as Size;\n out.width = Math.abs(this.scale.x) * this._texture.orig.width;\n out.height = Math.abs(this.scale.y) * this._texture.orig.height;\n\n return out;\n }\n\n /**\n * Sets the size of the Sprite to the specified width and height.\n * This is faster than setting width and height separately as it only recalculates bounds once.\n * @example\n * ```ts\n * // Basic size setting\n * const sprite = new Sprite(Texture.from('sprite.png'));\n * sprite.setSize(100, 200); // Width: 100, Height: 200\n *\n * // Set uniform size\n * sprite.setSize(100); // Sets both width and height to 100\n *\n * // Set size with object\n * sprite.setSize({\n * width: 200,\n * height: 300\n * });\n *\n * // Reset to texture size\n * sprite.setSize(\n * sprite.texture.orig.width,\n * sprite.texture.orig.height\n * );\n * ```\n * @param value - This can be either a number or a {@link Size} object\n * @param height - The height to set. Defaults to the value of `width` if not provided\n * @see {@link Sprite#width} For setting width only\n * @see {@link Sprite#height} For setting height only\n * @see {@link Sprite#texture} For the source dimensions\n */\n public override setSize(value: number | Optional<Size, 'height'>, height?: number)\n {\n if (typeof value === 'object')\n {\n height = value.height ?? value.width;\n value = value.width;\n }\n else\n {\n height ??= value;\n }\n\n value !== undefined && this._setWidth(value, this._texture.orig.width);\n height !== undefined && this._setHeight(height, this._texture.orig.height);\n }\n}\n"],"names":[],"mappings":";;;;;;;AAqIO,MAAM,eAAe,aAC5B,CAAA;AAAA;AAAA;AAAA;AAAA,EAoDI,WAAA,CAAY,OAAmC,GAAA,OAAA,CAAQ,KACvD,EAAA;AACI,IAAA,IAAI,mBAAmB,OACvB,EAAA;AACI,MAAU,OAAA,GAAA,EAAE,SAAS,OAAQ,EAAA,CAAA;AAAA,KACjC;AAGA,IAAM,MAAA,EAAE,OAAU,GAAA,OAAA,CAAQ,KAAO,EAAA,MAAA,EAAQ,aAAa,KAAO,EAAA,MAAA,EAAQ,GAAG,IAAA,EAAS,GAAA,OAAA,CAAA;AAEjF,IAAM,KAAA,CAAA;AAAA,MAC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