/** * Options of the `sprite` component accepted by {@link SpriteComponentSystem} that differ from the * properties of {@link SpriteComponent}. Each replaces the same-named property of the options that * {@link Entity#addComponent} derives from the component class; see * {@link ComponentOptionsOverrides}. */ export type SpriteComponentOptionsOverrides = { /** * - Same as {@link SpriteComponent#batchGroupId}. `null` * selects no batch group. */ batchGroupId?: number | null; /** * - * Same as {@link SpriteComponent#clips}, also accepting the plain clip data of * {@link SpriteComponent#addClip}. */ clips?: { [name: string]: SpriteAnimationClip | { name?: string; fps?: number; loop?: boolean; spriteAsset?: number; }; }; /** * - Same as {@link SpriteComponent#color}, also accepting an * `[r, g, b]` array. */ color?: Color | number[]; }; /** * @import { AppBase } from '../../app-base.js' * @import { Entity } from '../../entity.js' * @import { SpriteAnimationClip } from './sprite-animation-clip.js' */ /** * Options of the `sprite` component accepted by {@link SpriteComponentSystem} that differ from the * properties of {@link SpriteComponent}. Each replaces the same-named property of the options that * {@link Entity#addComponent} derives from the component class; see * {@link ComponentOptionsOverrides}. * * @typedef {object} SpriteComponentOptionsOverrides * @property {number | null} [batchGroupId] - Same as {@link SpriteComponent#batchGroupId}. `null` * selects no batch group. * @property {{ [name: string]: SpriteAnimationClip | { name?: string, fps?: number, loop?: boolean, spriteAsset?: number } }} [clips] - * Same as {@link SpriteComponent#clips}, also accepting the plain clip data of * {@link SpriteComponent#addClip}. * @property {Color | number[]} [color] - Same as {@link SpriteComponent#color}, also accepting an * `[r, g, b]` array. * @ignore */ /** * Manages the {@link SpriteComponent}s of an application. Reach it through `app.systems.sprite`; * components are created with {@link Entity#addComponent}, never by calling the system directly. * * @category Graphics */ export class SpriteComponentSystem extends ComponentSystem { id: string; ComponentType: typeof SpriteComponent; _defaultTexture: Texture; _defaultMaterial: any; _default9SlicedMaterialSlicedMode: any; _default9SlicedMaterialTiledMode: any; set defaultMaterial(material: any); get defaultMaterial(): any; set default9SlicedMaterialSlicedMode(material: any); get default9SlicedMaterialSlicedMode(): any; set default9SlicedMaterialTiledMode(material: any); get default9SlicedMaterialTiledMode(): any; initializeComponentData(component: any, data: any, properties: any): void; cloneComponent(entity: any, clone: any): import("../component.js").Component; onUpdate(dt: any): void; onBeforeRemove(entity: any, component: any): void; } import type { SpriteAnimationClip } from './sprite-animation-clip.js'; import { Color } from '../../../core/math/color.js'; import { ComponentSystem } from '../system.js'; import { SpriteComponent } from './component.js'; import { Texture } from '../../../platform/graphics/texture.js';