@combos-fun/plugin-renderer 0.1.22 → 0.1.24

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/agent-skill.md CHANGED
@@ -13,7 +13,7 @@
13
13
  import { RendererSystem, Transform2D } from '@combos-fun/plugin-renderer';
14
14
  ```
15
15
 
16
- `RendererSystem.systemName = 'Renderer'`. Add it before every 2D leaf system. Params: `canvas`, `width`, `height`, `resolution`, `backgroundColor`, `backgroundAlpha`, `antialias`. Forced: `autoStart: true`, `sharedTicker: true`. `transparent`, `enableScroll`, and `renderType` are ignored. `resize(width, height)` resizes the primary app. `LOAD_SCENE_MODE.MULTI_CANVAS` creates another app. `RESOURCE_KEY_SPLIT` is `'_s|r|c_'`. `getSystem(RendererSystem)` or `'Renderer'`. Match `resolution` with `PhysicsSystem`.
16
+ `RendererSystem.systemName = 'Renderer'`. Add it before every 2D leaf system. Params: `canvas`, `width`, `height`, `resolution`, `backgroundColor`, `backgroundAlpha`, `antialias`, `adaptivePixelRatio` (default `false`). Forced: `autoStart: true`, `sharedTicker: true`. `transparent`, `enableScroll`, and `renderType` are ignored. `resize(width, height)` resizes the primary app. `LOAD_SCENE_MODE.MULTI_CANVAS` creates another app. `RESOURCE_KEY_SPLIT` is `'_s|r|c_'`. `getSystem(RendererSystem)` or `'Renderer'`. Match `resolution` with `PhysicsSystem`.
17
17
 
18
18
  `new GameObject(name)` then `addComponent(new Transform2D({ position, size, origin, anchor, scale, rotation }))`. Vectors are `{ x, y }`. `size` is `{ width, height }`. Pose is not a GameObject constructor argument. A parented node with no `Transform2D` gets one.
19
19
 
@@ -368,12 +368,17 @@ let Renderer$2 = class Renderer extends engine.System {
368
368
  this.adaptive = null;
369
369
  this.viewWidth = 0;
370
370
  this.viewHeight = 0;
371
+ this.pixelRatio = 1;
372
+ this.resizeObserver = null;
373
+ this.viewListeners = new Set();
374
+ this.displayFrame = null;
371
375
  }
372
376
  static { }
373
377
  static { this.systemName = 'Renderer'; }
374
378
  async init(params) {
375
379
  this.params = params ?? {};
376
380
  this.quality = engine.resolveRenderQuality(this.params, { adaptivePixelRatio: false });
381
+ this.pixelRatio = this.quality.pixelRatio;
377
382
  this.adaptive = new engine.AdaptivePixelRatio({
378
383
  pixelRatio: this.quality.pixelRatio,
379
384
  ceiling: this.quality.pixelRatioCeiling,
@@ -383,6 +388,7 @@ let Renderer$2 = class Renderer extends engine.System {
383
388
  this.rememberView(app);
384
389
  this.application = app;
385
390
  this.game.canvas = app.canvas;
391
+ this.observeCanvas(app.canvas);
386
392
  this.containerManager = new ContainerManager();
387
393
  this.rendererManager = new RendererManager({
388
394
  game: this.game,
@@ -498,10 +504,58 @@ let Renderer$2 = class Renderer extends engine.System {
498
504
  if (engine.shouldPauseRendering(this.quality?.pauseWhenHidden !== false))
499
505
  return;
500
506
  const next = this.adaptive?.sample(e?.deltaTime ?? 0);
501
- if (next != null)
502
- this.applyPixelRatio(next);
507
+ if (next != null) {
508
+ this.pixelRatio = next;
509
+ this.applyDisplay();
510
+ }
503
511
  this.application.ticker.update(e.time);
504
512
  }
513
+ onDisplayFrame(listener) {
514
+ this.viewListeners.add(listener);
515
+ if (this.displayFrame)
516
+ listener(this.displayFrame);
517
+ return () => {
518
+ this.viewListeners.delete(listener);
519
+ };
520
+ }
521
+ observeCanvas(canvas) {
522
+ this.resizeObserver?.disconnect();
523
+ if (typeof ResizeObserver !== 'undefined') {
524
+ this.resizeObserver = new ResizeObserver(() => this.applyDisplay());
525
+ this.resizeObserver.observe(canvas);
526
+ }
527
+ this.applyDisplay();
528
+ }
529
+ applyDisplay() {
530
+ const app = this.application;
531
+ const canvas = app?.canvas;
532
+ if (!app || !canvas || this.viewWidth <= 0 || this.viewHeight <= 0)
533
+ return;
534
+ if (typeof canvas.getBoundingClientRect !== 'function')
535
+ return;
536
+ const box = canvas.getBoundingClientRect();
537
+ const frame = engine.fitOrthographicDisplay({
538
+ box: { width: box.width, height: box.height },
539
+ width: this.viewWidth,
540
+ height: this.viewHeight,
541
+ resolution: this.pixelRatio,
542
+ });
543
+ if (!frame)
544
+ return;
545
+ const current = this.displayFrame;
546
+ if (current
547
+ && current.bufferWidth === frame.bufferWidth
548
+ && current.bufferHeight === frame.bufferHeight
549
+ && Math.abs(current.originX - frame.originX) < 1e-4
550
+ && Math.abs(current.visibleWidth - frame.visibleWidth) < 1e-4) {
551
+ return;
552
+ }
553
+ app.renderer.resize(frame.visibleWidth, frame.visibleHeight, frame.pixelRatio);
554
+ app.stage.position.set(-frame.originX, -frame.originY);
555
+ this.displayFrame = frame;
556
+ for (const listener of this.viewListeners)
557
+ listener(frame);
558
+ }
505
559
  rememberView(app) {
506
560
  const width = this.params?.width || app.renderer?.screen?.width || 0;
507
561
  const height = this.params?.height || app.renderer?.screen?.height || 0;
@@ -510,16 +564,11 @@ let Renderer$2 = class Renderer extends engine.System {
510
564
  if (height)
511
565
  this.viewHeight = height;
512
566
  }
513
- applyPixelRatio(ratio) {
514
- const renderer = this.application?.renderer;
515
- if (!renderer || !(ratio > 0))
516
- return;
517
- renderer.resolution = ratio;
518
- if (this.viewWidth > 0 && this.viewHeight > 0) {
519
- renderer.resize(this.viewWidth, this.viewHeight);
520
- }
521
- }
522
567
  onDestroy() {
568
+ this.resizeObserver?.disconnect();
569
+ this.resizeObserver = null;
570
+ this.viewListeners.clear();
571
+ this.displayFrame = null;
523
572
  this.application?.destroy();
524
573
  for (const app of this.multiApps) {
525
574
  app && app.destroy();
@@ -540,7 +589,8 @@ let Renderer$2 = class Renderer extends engine.System {
540
589
  this.params = { ...this.params, width, height };
541
590
  this.viewWidth = width;
542
591
  this.viewHeight = height;
543
- this.application.renderer.resize(width, height);
592
+ this.displayFrame = null;
593
+ this.applyDisplay();
544
594
  }
545
595
  };
546
596
  Renderer$2 = tslib.__decorate([
@@ -554,7 +604,7 @@ var Renderer$1 = Renderer$2;
554
604
  /** Auto-generated by scripts/build-package.mjs — do not edit. */
555
605
  Object.assign(Renderer$1, {
556
606
  packageName: "@combos-fun/plugin-renderer",
557
- packageVersion: "0.1.22",
607
+ packageVersion: "0.1.24",
558
608
  });
559
609
 
560
610
  /* eslint-disable @typescript-eslint/no-unused-vars */
@@ -1 +1 @@
1
- {"version":3,"file":"plugin-renderer.cjs.js","sources":["../lib/manager/RendererManager.ts","../lib/manager/ContainerManager.ts","../lib/Transform2D.ts","../lib/PixiHierarchy.ts","../lib/compressedTexture/ability.ts","../lib/renderOptions.ts","../lib/System.ts","../lib/__combosPackageMeta.gen.ts","../lib/Renderer.ts","../lib/imageTexture.ts","../lib/index.ts"],"sourcesContent":["import isEqual from 'lodash-es/isEqual';\nimport { GameObject, Game, ComponentChanged, OBSERVER_TYPE } from '@combos-fun/engine';\nimport Renderer from '../Renderer';\nimport RendererSystem from '../System';\n\nclass RendererManager {\n game: Game;\n rendererSystem: RendererSystem;\n constructor({ game, rendererSystem }) {\n this.game = game;\n this.rendererSystem = rendererSystem;\n }\n renderers: Renderer[] = [];\n register(...renderers: Renderer[]) {\n for (const renderer of renderers) {\n renderer.game = this.game;\n renderer.rendererManager = this.rendererSystem.rendererManager;\n renderer.containerManager = this.rendererSystem.containerManager;\n this.renderers.push(renderer);\n }\n }\n componentChanged(changes: ComponentChanged[]) {\n for (const changed of changes) {\n for (const renderer of this.renderers) {\n const props = renderer.observerInfo[changed.componentName];\n if (props) {\n if ([OBSERVER_TYPE.ADD, OBSERVER_TYPE.REMOVE].indexOf(changed.type) > -1) {\n try {\n renderer.componentChanged && renderer.componentChanged(changed);\n } catch (e) {\n console.error(`gameObject: ${changed.gameObject.name}, ${changed.componentName} is error.`, changed, e);\n }\n continue;\n }\n\n const index = props.findIndex(prop => {\n return isEqual(prop, changed.prop);\n });\n\n if (index > -1) {\n try {\n renderer.componentChanged && renderer.componentChanged(changed);\n } catch (e) {\n console.error(\n `gameObject: ${changed.gameObject && changed.gameObject.name}, ${\n changed.componentName\n } is componentChanged error.`,\n changed,\n e,\n );\n }\n }\n }\n }\n }\n }\n update(gameObject: GameObject) {\n for (const component of gameObject.components) {\n for (const renderer of this.renderers) {\n const cache = [];\n const props = renderer.observerInfo[component.name];\n if (props && cache.indexOf(gameObject) === -1) {\n cache.push(gameObject);\n try {\n renderer.rendererUpdate && renderer.rendererUpdate(gameObject);\n } catch (e) {\n console.info(`gameObject: ${gameObject.name}, ${component.name} is update error`, e);\n }\n }\n }\n }\n }\n}\nexport default RendererManager;\n","import { Point, ObservablePoint } from 'pixi.js';\nimport { Container } from '@combos-fun/renderer-adapter';\nimport type Transform2D from '../Transform2D';\n\nexport default class ContainerManager {\n containerMap: { [propName: number]: Container } = {};\n addContainer({ name, container }: { name: number; container: Container }) {\n this.containerMap[name] = container;\n }\n getContainer(name: number) {\n return this.containerMap[name];\n }\n removeContainer(name: number) {\n this.containerMap[name]?.destroy({ children: true });\n delete this.containerMap[name];\n }\n updateTransform({\n name,\n transform,\n parentSize,\n }: {\n name: number;\n transform: Transform2D;\n parentSize?: { width: number; height: number };\n }) {\n const container = this.containerMap[name];\n if (!container || !transform) return;\n const { anchor, origin, position, rotation, scale, size, skew } = transform;\n container.rotation = rotation;\n container.scale = scale as Point;\n container.pivot.x = size.width * origin.x;\n container.pivot.y = size.height * origin.y;\n container.skew = skew as ObservablePoint;\n let x = position.x;\n let y = position.y;\n if (parentSize) {\n x = x + parentSize.width * anchor.x;\n y = y + parentSize.height * anchor.y;\n }\n\n container.position = { x, y } as Point;\n }\n}\n","import { Component } from '@combos-fun/engine';\nimport type { ComponentParams } from '@combos-fun/engine';\nimport { Field } from '@combos-fun/inspector-decorator';\n\ninterface Vector2 {\n x: number;\n y: number;\n}\n\ninterface Size2 {\n width: number;\n height: number;\n}\n\nexport interface TransformMatrix {\n a: number;\n b: number;\n c: number;\n d: number;\n tx: number;\n ty: number;\n array?: number[];\n}\n\nexport interface Transform2DParams extends ComponentParams {\n position?: Vector2;\n size?: Size2;\n origin?: Vector2;\n anchor?: Vector2;\n scale?: Vector2;\n skew?: Vector2;\n rotation?: number;\n}\n\n/** 2D layout pose. Hierarchy lives on GameObject. */\nclass Transform2D extends Component<Transform2DParams> {\n static componentName: string = 'Transform2D';\n readonly name: string = 'Transform2D';\n\n worldTransform: TransformMatrix;\n\n init(params: Transform2DParams = {}) {\n const props = ['position', 'size', 'origin', 'anchor', 'scale', 'skew'];\n for (const key of props) {\n Object.assign(this[key], params[key]);\n }\n this.rotation = params.rotation ?? this.rotation;\n }\n\n @Field({\n type: 'vector2',\n step: 1,\n group: 'Transform2D',\n label: 'Position',\n description: 'Position on the design canvas (x right, y down).',\n })\n position: Vector2 = {x: 0, y: 0};\n\n @Field({\n type: 'size',\n step: 1,\n min: 0,\n group: 'Transform2D',\n label: 'Size',\n description: 'Width and height of the object in design pixels.',\n })\n size: Size2 = {width: 0, height: 0};\n\n @Field({\n type: 'vector2',\n step: 0.1,\n group: 'Transform2D',\n label: 'Origin',\n description: 'Local origin used for layout math.',\n })\n origin: Vector2 = {x: 0, y: 0};\n\n @Field({\n type: 'vector2',\n step: 0.1,\n group: 'Transform2D',\n label: 'Anchor',\n description: 'Anchor point (0–1) used when positioning and scaling.',\n })\n anchor: Vector2 = {x: 0, y: 0};\n\n @Field({\n type: 'vector2',\n step: 0.1,\n group: 'Transform2D',\n label: 'Scale',\n description: 'Scale multipliers on X and Y (1 = original size).',\n })\n scale: Vector2 = {x: 1, y: 1};\n\n @Field({\n type: 'vector2',\n step: 0.1,\n group: 'Transform2D',\n label: 'Skew',\n description: 'Skew amounts on X and Y.',\n })\n skew: Vector2 = {x: 0, y: 0};\n\n @Field({\n type: 'number',\n step: 0.1,\n group: 'Transform2D',\n label: 'Rotation',\n description: 'Rotation in radians.',\n editor: 'number-stepper',\n })\n rotation: number = 0;\n}\n\nexport default Transform2D;\n","import { decorators, ComponentChanged, OBSERVER_TYPE, Scene, LOAD_SCENE_MODE, GameObject } from '@combos-fun/engine';\nimport EventEmitter from 'eventemitter3';\nimport { Application, Container } from '@combos-fun/renderer-adapter';\nimport Render from './System';\nimport ContainerManager from './manager/ContainerManager';\nimport Transform2D from './Transform2D';\n\ntype RenderSortDirty = { sortDirty: boolean };\n\n@decorators.componentObserver({\n GameObject: ['parent'],\n Transform2D: [],\n})\nexport default class PixiHierarchy extends EventEmitter {\n name: string = 'PixiHierarchy';\n waitRemoveIds: number[] = [];\n system: Render;\n containerManager: ContainerManager;\n waitChangeScenes: {\n scene: Scene;\n mode: LOAD_SCENE_MODE;\n application: Application;\n }[] = [];\n constructor({ system, containerManager }) {\n super();\n this.containerManager = containerManager;\n this.init(system);\n }\n init(system: Render) {\n this.system = system;\n this.on('changeScene', ({ scene, mode, application }) => {\n this.waitChangeScenes.push({ scene, mode, application });\n });\n }\n update() {\n for (const id of this.waitRemoveIds) {\n this.containerManager.removeContainer(id);\n }\n this.waitRemoveIds = [];\n\n for (const sceneInfo of this.waitChangeScenes) {\n this.ensureSceneContainer(sceneInfo.scene);\n const container = this.containerManager.getContainer(sceneInfo.scene.id);\n if (container) {\n sceneInfo.application.stage.removeChildren();\n sceneInfo.application.stage.addChild(container);\n }\n }\n this.waitChangeScenes = [];\n }\n ensureSceneContainer(scene: Scene) {\n if (this.containerManager.getContainer(scene.id)) return;\n const container = new Container();\n container.label = scene.name;\n this.containerManager.addContainer({\n name: scene.id,\n container,\n });\n }\n ensureContainer(gameObject: GameObject, transform: Transform2D) {\n if (this.containerManager.getContainer(gameObject.id)) {\n transform.worldTransform = this.containerManager.getContainer(gameObject.id)\n .worldTransform as unknown as Transform2D['worldTransform'];\n return;\n }\n const container = new Container();\n container.label = gameObject.name;\n this.containerManager.addContainer({\n name: gameObject.id,\n container,\n });\n transform.worldTransform = container.worldTransform as unknown as Transform2D['worldTransform'];\n }\n componentChanged(changed: ComponentChanged) {\n if (changed.componentName === 'GameObject') {\n this.reparent(changed.gameObject);\n return;\n }\n if (changed.componentName !== 'Transform2D') return;\n if (changed.type === OBSERVER_TYPE.ADD) {\n this.ensureContainer(changed.gameObject, changed.component as Transform2D);\n this.reparent(changed.gameObject);\n } else if (changed.type === OBSERVER_TYPE.REMOVE) {\n this.waitRemoveIds.push(changed.gameObject.id);\n }\n }\n reparent(gameObject?: GameObject) {\n if (!gameObject) return;\n const container = this.containerManager.getContainer(gameObject.id);\n if (!container) return;\n if (gameObject.parent) {\n const parentContainer = this.containerManager.getContainer(gameObject.parent.id);\n if (parentContainer && container.parent !== parentContainer) {\n parentContainer.addChild(container);\n }\n const render = gameObject.parent.getComponent('Render') as unknown as RenderSortDirty;\n if (render) {\n render.sortDirty = true;\n }\n } else if (container.parent) {\n const transform = gameObject.getComponent(Transform2D);\n if (transform) {\n delete transform.worldTransform;\n }\n container.parent.removeChild(container);\n }\n }\n destroy() {\n this.removeAllListeners();\n this.waitRemoveIds = null;\n this.waitChangeScenes = null;\n this.system = null;\n this.containerManager = null;\n }\n}\n","/**\n * Inspired by PixiJS v6\n */\nexport type CompressedTextureExtensions = {\n s3tc?: WEBGL_compressed_texture_s3tc,\n s3tc_sRGB: WEBGL_compressed_texture_s3tc_srgb,\n etc: WEBGL_compressed_texture_etc,\n etc1: WEBGL_compressed_texture_etc1,\n pvrtc: WEBKIT_WEBGL_compressed_texture_pvrtc,\n atc: WEBGL_compressed_texture_atc,\n astc: WEBGL_compressed_texture_astc\n};\nexport type CompressedTextureExtensionRef = keyof CompressedTextureExtensions;\nlet result = undefined;\nexport interface SuportedCompressedTexture {\n s3tc: boolean,\n etc: boolean,\n etc1: boolean,\n pvrtc: boolean,\n atc: boolean,\n astc: boolean,\n}\nexport function getSuportCompressedTextureFormats(gl: WebGLRenderingContext): SuportedCompressedTexture {\n if (result) return result;\n\n if (!gl) {\n // #if _DEBUG\n console.warn('WebGL not available for compressed textures. Silently failing.');\n // #endif\n\n return {\n s3tc: false,\n etc: false,\n etc1: false,\n pvrtc: false,\n atc: false,\n astc: false,\n };\n }\n\n result = {\n s3tc: !!gl.getExtension('WEBGL_compressed_texture_s3tc'),\n etc: !!gl.getExtension('WEBGL_compressed_texture_etc'),\n etc1: !!gl.getExtension('WEBGL_compressed_texture_etc1'),\n pvrtc: !!gl.getExtension('WEBGL_compressed_texture_pvrtc')\n || !!gl.getExtension('WEBKIT_WEBGL_compressed_texture_pvrtc'),\n atc: !!gl.getExtension('WEBGL_compressed_texture_atc'),\n astc: !!gl.getExtension('WEBGL_compressed_texture_astc')\n };\n\n try {\n console.log('Supported compressed texture formats: ' + Object.keys(result).filter((type) => result[type]).join(', '))\n } catch (e) { }\n return result;\n}","import type { ApplicationOptions } from 'pixi.js';\nimport type { RenderQualityInput, ResolvedRenderQuality } from '@combos-fun/engine';\n\n/** Pixi init options with engine-only quality fields removed. */\nexport function pixiRenderOptions(\n params: Partial<ApplicationOptions> & RenderQualityInput = {},\n quality: ResolvedRenderQuality,\n): Partial<ApplicationOptions> {\n const {\n maxPixelRatio: _maxPixelRatio,\n adaptivePixelRatio: _adaptivePixelRatio,\n pauseWhenHidden: _pauseWhenHidden,\n pixelRatio: _pixelRatio,\n devicePixelRatio: _devicePixelRatio,\n ...rest\n } = params;\n return {\n ...rest,\n resolution: quality.pixelRatio,\n autoDensity: quality.autoDensity,\n antialias: quality.antialias,\n ...(quality.powerPreference === 'default' ? {} : { powerPreference: quality.powerPreference }),\n autoStart: true,\n sharedTicker: true,\n };\n}\n","import { System, decorators, Game, LOAD_SCENE_MODE, PureObserverInfo, AdaptivePixelRatio, resolveRenderQuality, shouldPauseRendering } from '@combos-fun/engine';\nimport type { RenderQualityInput, ResolvedRenderQuality, UpdateParams } from '@combos-fun/engine';\nimport { Application } from '@combos-fun/renderer-adapter';\nimport RendererManager from './manager/RendererManager';\nimport ContainerManager from './manager/ContainerManager';\nimport PixiHierarchy from './PixiHierarchy';\nimport Transform2D from './Transform2D';\nimport { Ticker } from 'pixi.js';\nimport type { ApplicationOptions } from 'pixi.js';\nimport type { WebGLRenderer } from 'pixi.js';\nimport { registerCompressedTexture } from './compressedTexture';\nimport { SuportedCompressedTexture, getSuportCompressedTextureFormats } from './compressedTexture/ability';\nimport { pixiRenderOptions } from './renderOptions';\n\nexport enum RENDERER_TYPE {\n UNKNOWN = 0,\n WEBGL = 1,\n CANVAS = 2,\n}\n\n@decorators.componentObserver({\n GameObject: ['parent'],\n Transform2D: [],\n})\nexport default class Renderer extends System<Partial<ApplicationOptions> & RenderQualityInput> {\n static systemName: string = 'Renderer';\n params: Partial<ApplicationOptions> & RenderQualityInput;\n rendererManager: RendererManager;\n containerManager: ContainerManager;\n application: Application | null = null;\n game: Game;\n hierarchy: PixiHierarchy;\n multiApps: Application[] = [];\n suportedCompressedTextureFormats: SuportedCompressedTexture;\n private quality: ResolvedRenderQuality | null = null;\n private adaptive: AdaptivePixelRatio | null = null;\n private viewWidth = 0;\n private viewHeight = 0;\n\n async init(params?: Partial<ApplicationOptions> & RenderQualityInput) {\n this.params = params ?? {};\n this.quality = resolveRenderQuality(this.params, { adaptivePixelRatio: false });\n this.adaptive = new AdaptivePixelRatio({\n pixelRatio: this.quality.pixelRatio,\n ceiling: this.quality.pixelRatioCeiling,\n enabled: this.quality.adaptivePixelRatio,\n });\n const app = await this.createApplication(this.params);\n this.rememberView(app);\n this.application = app;\n this.game.canvas = app.canvas;\n this.containerManager = new ContainerManager();\n this.rendererManager = new RendererManager({\n game: this.game,\n rendererSystem: this,\n });\n\n this.hierarchy = new PixiHierarchy({\n system: this,\n containerManager: this.containerManager,\n });\n this.game.on('sceneChanged', async ({ scene, mode, params: sceneParams }) => {\n let application: Application | null = this.application;\n if (mode === LOAD_SCENE_MODE.MULTI_CANVAS) {\n application = await this.createApplication(sceneParams);\n this.multiApps.push(application);\n }\n if (!application) {\n return;\n }\n scene.canvas = application.canvas;\n this.hierarchy.ensureSceneContainer(scene);\n this.hierarchy.emit('changeScene', {\n scene,\n mode,\n application,\n });\n });\n\n const gl = (app.renderer as WebGLRenderer).gl;\n if (gl) {\n this.suportedCompressedTextureFormats = getSuportCompressedTextureFormats(gl);\n registerCompressedTexture(gl);\n }\n }\n\n registerObserver(observerInfo: PureObserverInfo): void {\n const Ctor = this.constructor as typeof Renderer & { observerInfo: PureObserverInfo };\n if (!Ctor.observerInfo) {\n Ctor.observerInfo = {} as PureObserverInfo;\n }\n const thisObserverInfo = Ctor.observerInfo;\n for (const key in observerInfo) {\n if (!thisObserverInfo[key]) {\n thisObserverInfo[key] = [];\n }\n thisObserverInfo[key].push(...observerInfo[key]);\n }\n }\n\n private async createApplication(params: Partial<ApplicationOptions> & RenderQualityInput = {}): Promise<Application> {\n const quality = resolveRenderQuality(params, { adaptivePixelRatio: false });\n const callerPreference = params.preference;\n const initOptions = pixiRenderOptions(params, quality);\n initOptions.preference = callerPreference ?? ['webgpu', 'webgl'];\n\n const app = new Application();\n try {\n await app.init(initOptions);\n } catch {\n if (callerPreference == null) {\n try {\n await app.init({ ...initOptions, preference: 'webgl' });\n } catch {\n await app.init({ ...initOptions, preference: 'canvas' });\n }\n } else {\n await app.init({ ...initOptions, preference: 'canvas' });\n }\n }\n\n Ticker.shared.stop();\n Ticker.shared.autoStart = false;\n\n return app;\n }\n\n update() {\n const changes = this.componentObserver.clear();\n for (const changed of changes) {\n if (changed.componentName === 'GameObject' && changed.gameObject) {\n this.ensureTransform2D(changed.gameObject);\n if (changed.gameObject.parent) this.ensureTransform2D(changed.gameObject.parent);\n }\n this.hierarchy.componentChanged(changed);\n }\n if (!this.application) {\n return;\n }\n for (const gameObject of this.game.gameObjects) {\n const transform = gameObject.getComponent(Transform2D);\n if (transform) {\n this.containerManager.updateTransform({\n name: gameObject.id,\n transform,\n parentSize: gameObject.parent?.getComponent(Transform2D)?.size,\n });\n }\n this.rendererManager.update(gameObject);\n }\n }\n\n private ensureTransform2D(gameObject: Game['gameObjects'][number]) {\n if (!gameObject || gameObject.destroyed || gameObject === gameObject.scene) return;\n let transform = gameObject.getComponent(Transform2D);\n if (!transform) {\n transform = gameObject.addComponent(new Transform2D());\n }\n if (!transform) return;\n this.hierarchy.ensureContainer(gameObject, transform);\n this.hierarchy.reparent(gameObject);\n }\n\n lateUpdate(e: UpdateParams) {\n if (!this.application) {\n return;\n }\n this.hierarchy.update();\n if (shouldPauseRendering(this.quality?.pauseWhenHidden !== false)) return;\n const next = this.adaptive?.sample(e?.deltaTime ?? 0);\n if (next != null) this.applyPixelRatio(next);\n this.application.ticker.update(e.time);\n }\n\n private rememberView(app: Application) {\n const width = this.params?.width || app.renderer?.screen?.width || 0;\n const height = this.params?.height || app.renderer?.screen?.height || 0;\n if (width) this.viewWidth = width;\n if (height) this.viewHeight = height;\n }\n\n private applyPixelRatio(ratio: number) {\n const renderer = this.application?.renderer;\n if (!renderer || !(ratio > 0)) return;\n renderer.resolution = ratio;\n if (this.viewWidth > 0 && this.viewHeight > 0) {\n renderer.resize(this.viewWidth, this.viewHeight);\n }\n }\n\n onDestroy() {\n this.application?.destroy();\n for (const app of this.multiApps) {\n app && app.destroy();\n }\n this.hierarchy.destroy();\n this.hierarchy = null;\n this.params = null;\n this.rendererManager = null;\n this.containerManager = null;\n this.application = null;\n this.game = null;\n this.multiApps = null;\n }\n\n resize(width, height) {\n if (!this.application) {\n return;\n }\n this.params = { ...this.params, width, height };\n this.viewWidth = width;\n this.viewHeight = height;\n this.application.renderer.resize(width, height);\n }\n}\n","/** Auto-generated by scripts/build-package.mjs — do not edit. */\n\nimport Renderer from './System';\n\nObject.assign(Renderer, {\n packageName: \"@combos-fun/plugin-renderer\",\n packageVersion: \"0.1.22\",\n});\n","/* eslint-disable @typescript-eslint/no-unused-vars */\n\nimport { GameObject, Game, PureObserverInfo, ComponentChanged, System, UpdateParams } from '@combos-fun/engine';\nimport ContainerManager from './manager/ContainerManager';\nimport RendererManager from './manager/RendererManager';\n\nexport default class Renderer<T extends {} = {}> extends System<T> {\n /**\n * Renderer name\n */\n name: string;\n\n /**\n * currentGame\n */\n game: Game;\n\n /**\n * observer component props info\n */\n static observerInfo: PureObserverInfo;\n\n /**\n * observer component props info\n */\n observerInfo: PureObserverInfo;\n\n /**\n * containerManager\n */\n containerManager: ContainerManager;\n rendererManager: RendererManager;\n\n constructor(params?: T) {\n super(params);\n const Ctor = this.constructor as typeof Renderer & { observerInfo: PureObserverInfo };\n this.observerInfo = Ctor.observerInfo;\n }\n\n // init(arg?: any): void;\n\n /**\n * Called when an observed component property changes.\n */\n componentChanged(_changed: ComponentChanged) { }\n\n /**\n * Called every frame.\n * @param _gameObject gameObject\n */\n rendererUpdate(_gameObject: GameObject) { }\n\n override update(e?: UpdateParams): void {\n const changes = this.componentObserver.clear();\n for (const changed of changes) {\n this.componentChanged(changed);\n }\n }\n\n protected asyncIdMap: Record<number, number> = {}\n\n protected increaseAsyncId(id: number) {\n this.asyncIdMap[id] = (this.asyncIdMap[id] || 0) + 1;\n return this.asyncIdMap[id];\n }\n\n protected validateAsyncId(id: number, asyncId: number) {\n return this.asyncIdMap[id] === asyncId;\n }\n}\n","import { compressedTextureUrl, imageFallbackUrl, RESOURCE_TYPE, resource } from '@combos-fun/engine';\nimport type { ResourceStruct } from '@combos-fun/engine';\nimport { CompressedSource, Texture, getSupportedTextureFormats, loadKTX2onWorker } from 'pixi.js';\nimport type { TEXTURE_FORMATS } from 'pixi.js';\n\n/** Compressed targets only. RGBA is omitted so Basis is never expanded to uncompressed pixels. */\nconst COMPRESSED_TARGETS = [\n 'astc-4x4-unorm',\n 'bc7-rgba-unorm',\n 'bc3-rgba-unorm',\n 'etc2-rgba8unorm',\n] as const satisfies readonly TEXTURE_FORMATS[];\n\nfunction asArrayBuffer(data: unknown): ArrayBuffer | null {\n if (data instanceof ArrayBuffer) return data;\n if (ArrayBuffer.isView(data)) {\n const view = data as ArrayBufferView;\n return view.buffer.slice(view.byteOffset, view.byteOffset + view.byteLength) as ArrayBuffer;\n }\n return null;\n}\n\nfunction loadHtmlImage(url: string): Promise<HTMLImageElement> {\n return new Promise((resolve, reject) => {\n const image = new Image();\n image.crossOrigin = 'anonymous';\n image.onload = () => resolve(image);\n image.onerror = () => reject(new Error(`Failed to load image ${url}`));\n image.src = url;\n });\n}\n\nasync function textureFromElement(image: HTMLImageElement): Promise<Texture> {\n if (typeof createImageBitmap !== 'function') return Texture.from(image);\n let bitmap: ImageBitmap | null = null;\n try {\n bitmap = await createImageBitmap(image);\n return Texture.from(bitmap);\n } catch {\n try {\n bitmap?.close();\n } catch {\n // ImageBitmap.close throws once the bitmap is already detached.\n }\n return Texture.from(image);\n }\n}\n\nasync function loadPixiKtx2(url: string): Promise<Texture | null> {\n try {\n const supported = await getSupportedTextureFormats();\n const compressed = COMPRESSED_TARGETS.filter((format) => supported.includes(format));\n if (!compressed.length) return null;\n const options = await loadKTX2onWorker(url, compressed);\n if (!options?.resource || !COMPRESSED_TARGETS.includes(options.format as typeof COMPRESSED_TARGETS[number])) {\n return null;\n }\n return new Texture({ source: new CompressedSource(options) });\n } catch {\n return null;\n }\n}\n\nasync function loadCompressed(res: ResourceStruct, imageData: unknown): Promise<Texture | null> {\n const buffer = asArrayBuffer(imageData);\n if (!buffer) return null;\n const url = compressedTextureUrl(res.src?.image);\n const blobUrl = URL.createObjectURL(new Blob([buffer]));\n try {\n const texture = await loadPixiKtx2(blobUrl);\n if (texture) return texture;\n } finally {\n URL.revokeObjectURL(blobUrl);\n }\n if (!url) return null;\n return loadPixiKtx2(url);\n}\n\n/** Build the shared 2D texture. KTX2 bytes are transcoded; a raster element is uploaded as-is. */\nexport async function createImageTexture(res: ResourceStruct): Promise<Texture | undefined> {\n const imageData = res.data?.image;\n const compressed = await loadCompressed(res, imageData);\n if (compressed) return compressed;\n if (typeof HTMLImageElement !== 'undefined' && imageData instanceof HTMLImageElement) {\n return textureFromElement(imageData);\n }\n const fallback = imageFallbackUrl(res.src?.image);\n if (!fallback) return undefined;\n try {\n return textureFromElement(await loadHtmlImage(fallback));\n } catch {\n return undefined;\n }\n}\n\n/** Texture already built for this resource. Falls back to a raster element when no instance exists. */\nexport function imageResourceTexture(res: ResourceStruct | null | undefined): Texture | undefined {\n if (res?.instance instanceof Texture) return res.instance;\n const image = res?.data?.image;\n if (typeof HTMLImageElement !== 'undefined' && image instanceof HTMLImageElement) {\n return Texture.from(image);\n }\n return undefined;\n}\n\nexport function releaseImageTexture(texture: Texture) {\n const source = texture.source?.resource;\n texture.destroy(true);\n if (typeof ImageBitmap !== 'undefined' && source instanceof ImageBitmap) {\n try {\n source.close();\n } catch {\n // Already closed by the texture source.\n }\n }\n}\n\nresource.registerInstance(RESOURCE_TYPE.IMAGE, async (res) => createImageTexture(res));\nresource.registerDestroy(RESOURCE_TYPE.IMAGE, ({ instance }) => {\n if (!instance || instance === Texture.EMPTY) return;\n releaseImageTexture(instance as Texture);\n});\n","import RendererSystem, { RENDERER_TYPE } from './System';\nimport RendererManager from './manager/RendererManager';\nimport ContainerManager from './manager/ContainerManager';\nimport Renderer from './Renderer';\nimport Transform2D from './Transform2D';\nimport { createImageTexture, imageResourceTexture, releaseImageTexture } from './imageTexture';\n\n/** Shared resource cache key separator used across renderer plugins */\nexport const RESOURCE_KEY_SPLIT = '_s|r|c_';\n\nexport type { Transform2DParams, TransformMatrix } from './Transform2D';\nexport { RendererManager, ContainerManager, RendererSystem, RENDERER_TYPE, Renderer, Transform2D };\nexport { createImageTexture, imageResourceTexture, releaseImageTexture };\n\n"],"names":["OBSERVER_TYPE","isEqual","Component","__decorate","Field","PixiHierarchy","EventEmitter","Container","decorators","RENDERER_TYPE","Renderer","System","resolveRenderQuality","AdaptivePixelRatio","LOAD_SCENE_MODE","Application","Ticker","shouldPauseRendering","Texture","getSupportedTextureFormats","loadKTX2onWorker","CompressedSource","compressedTextureUrl","imageFallbackUrl","resource","RESOURCE_TYPE"],"mappings":";;;;;;;;;;;;;;;AAKA,MAAM,eAAe,CAAA;AAGnB,IAAA,WAAA,CAAY,EAAE,IAAI,EAAE,cAAc,EAAE,EAAA;QAIpC,IAAA,CAAA,SAAS,GAAe,EAAE;AAHxB,QAAA,IAAI,CAAC,IAAI,GAAG,IAAI;AAChB,QAAA,IAAI,CAAC,cAAc,GAAG,cAAc;IACtC;IAEA,QAAQ,CAAC,GAAG,SAAqB,EAAA;AAC/B,QAAA,KAAK,MA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ts","../lib/compressedTexture/ability.ts","../lib/renderOptions.ts","../lib/System.ts","../lib/__combosPackageMeta.gen.ts","../lib/Renderer.ts","../lib/imageTexture.ts","../lib/index.ts"],"sourcesContent":["import isEqual from 'lodash-es/isEqual';\nimport { GameObject, Game, ComponentChanged, OBSERVER_TYPE } from '@combos-fun/engine';\nimport Renderer from '../Renderer';\nimport RendererSystem from '../System';\n\nclass RendererManager {\n game: Game;\n rendererSystem: RendererSystem;\n constructor({ game, rendererSystem }) {\n this.game = game;\n this.rendererSystem = rendererSystem;\n }\n renderers: Renderer[] = [];\n register(...renderers: Renderer[]) {\n for (const renderer of renderers) {\n renderer.game = this.game;\n renderer.rendererManager = this.rendererSystem.rendererManager;\n renderer.containerManager = this.rendererSystem.containerManager;\n this.renderers.push(renderer);\n }\n }\n componentChanged(changes: ComponentChanged[]) {\n for (const changed of changes) {\n for (const renderer of this.renderers) {\n const props = renderer.observerInfo[changed.componentName];\n if (props) {\n if ([OBSERVER_TYPE.ADD, OBSERVER_TYPE.REMOVE].indexOf(changed.type) > -1) {\n try {\n renderer.componentChanged && renderer.componentChanged(changed);\n } catch (e) {\n console.error(`gameObject: ${changed.gameObject.name}, ${changed.componentName} is error.`, changed, e);\n }\n continue;\n }\n\n const index = props.findIndex(prop => {\n return isEqual(prop, changed.prop);\n });\n\n if (index > -1) {\n try {\n renderer.componentChanged && renderer.componentChanged(changed);\n } catch (e) {\n console.error(\n `gameObject: ${changed.gameObject && changed.gameObject.name}, ${\n changed.componentName\n } is componentChanged error.`,\n changed,\n e,\n );\n }\n }\n }\n }\n }\n }\n update(gameObject: GameObject) {\n for (const component of gameObject.components) {\n for (const renderer of this.renderers) {\n const cache = [];\n const props = renderer.observerInfo[component.name];\n if (props && cache.indexOf(gameObject) === -1) {\n cache.push(gameObject);\n try {\n renderer.rendererUpdate && renderer.rendererUpdate(gameObject);\n } catch (e) {\n console.info(`gameObject: ${gameObject.name}, ${component.name} is update error`, e);\n }\n }\n }\n }\n }\n}\nexport default RendererManager;\n","import { Point, ObservablePoint } from 'pixi.js';\nimport { Container } from '@combos-fun/renderer-adapter';\nimport type Transform2D from '../Transform2D';\n\nexport default class ContainerManager {\n containerMap: { [propName: number]: Container } = {};\n addContainer({ name, container }: { name: number; container: Container }) {\n this.containerMap[name] = container;\n }\n getContainer(name: number) {\n return this.containerMap[name];\n }\n removeContainer(name: number) {\n this.containerMap[name]?.destroy({ children: true });\n delete this.containerMap[name];\n }\n updateTransform({\n name,\n transform,\n parentSize,\n }: {\n name: number;\n transform: Transform2D;\n parentSize?: { width: number; height: number };\n }) {\n const container = this.containerMap[name];\n if (!container || !transform) return;\n const { anchor, origin, position, rotation, scale, size, skew } = transform;\n container.rotation = rotation;\n container.scale = scale as Point;\n container.pivot.x = size.width * origin.x;\n container.pivot.y = size.height * origin.y;\n container.skew = skew as ObservablePoint;\n let x = position.x;\n let y = position.y;\n if (parentSize) {\n x = x + parentSize.width * anchor.x;\n y = y + parentSize.height * anchor.y;\n }\n\n container.position = { x, y } as Point;\n }\n}\n","import { Component } from '@combos-fun/engine';\nimport type { ComponentParams } from '@combos-fun/engine';\nimport { Field } from '@combos-fun/inspector-decorator';\n\ninterface Vector2 {\n x: number;\n y: number;\n}\n\ninterface Size2 {\n width: number;\n height: number;\n}\n\nexport interface TransformMatrix {\n a: number;\n b: number;\n c: number;\n d: number;\n tx: number;\n ty: number;\n array?: number[];\n}\n\nexport interface Transform2DParams extends ComponentParams {\n position?: Vector2;\n size?: Size2;\n origin?: Vector2;\n anchor?: Vector2;\n scale?: Vector2;\n skew?: Vector2;\n rotation?: number;\n}\n\n/** 2D layout pose. Hierarchy lives on GameObject. */\nclass Transform2D extends Component<Transform2DParams> {\n static componentName: string = 'Transform2D';\n readonly name: string = 'Transform2D';\n\n worldTransform: TransformMatrix;\n\n init(params: Transform2DParams = {}) {\n const props = ['position', 'size', 'origin', 'anchor', 'scale', 'skew'];\n for (const key of props) {\n Object.assign(this[key], params[key]);\n }\n this.rotation = params.rotation ?? this.rotation;\n }\n\n @Field({\n type: 'vector2',\n step: 1,\n group: 'Transform2D',\n label: 'Position',\n description: 'Position on the design canvas (x right, y down).',\n })\n position: Vector2 = {x: 0, y: 0};\n\n @Field({\n type: 'size',\n step: 1,\n min: 0,\n group: 'Transform2D',\n label: 'Size',\n description: 'Width and height of the object in design pixels.',\n })\n size: Size2 = {width: 0, height: 0};\n\n @Field({\n type: 'vector2',\n step: 0.1,\n group: 'Transform2D',\n label: 'Origin',\n description: 'Local origin used for layout math.',\n })\n origin: Vector2 = {x: 0, y: 0};\n\n @Field({\n type: 'vector2',\n step: 0.1,\n group: 'Transform2D',\n label: 'Anchor',\n description: 'Anchor point (0–1) used when positioning and scaling.',\n })\n anchor: Vector2 = {x: 0, y: 0};\n\n @Field({\n type: 'vector2',\n step: 0.1,\n group: 'Transform2D',\n label: 'Scale',\n description: 'Scale multipliers on X and Y (1 = original size).',\n })\n scale: Vector2 = {x: 1, y: 1};\n\n @Field({\n type: 'vector2',\n step: 0.1,\n group: 'Transform2D',\n label: 'Skew',\n description: 'Skew amounts on X and Y.',\n })\n skew: Vector2 = {x: 0, y: 0};\n\n @Field({\n type: 'number',\n step: 0.1,\n group: 'Transform2D',\n label: 'Rotation',\n description: 'Rotation in radians.',\n editor: 'number-stepper',\n })\n rotation: number = 0;\n}\n\nexport default Transform2D;\n","import { decorators, ComponentChanged, OBSERVER_TYPE, Scene, LOAD_SCENE_MODE, GameObject } from '@combos-fun/engine';\nimport EventEmitter from 'eventemitter3';\nimport { Application, Container } from '@combos-fun/renderer-adapter';\nimport Render from './System';\nimport ContainerManager from './manager/ContainerManager';\nimport Transform2D from './Transform2D';\n\ntype RenderSortDirty = { sortDirty: boolean };\n\n@decorators.componentObserver({\n GameObject: ['parent'],\n Transform2D: [],\n})\nexport default class PixiHierarchy extends EventEmitter {\n name: string = 'PixiHierarchy';\n waitRemoveIds: number[] = [];\n system: Render;\n containerManager: ContainerManager;\n waitChangeScenes: {\n scene: Scene;\n mode: LOAD_SCENE_MODE;\n application: Application;\n }[] = [];\n constructor({ system, containerManager }) {\n super();\n this.containerManager = containerManager;\n this.init(system);\n }\n init(system: Render) {\n this.system = system;\n this.on('changeScene', ({ scene, mode, application }) => {\n this.waitChangeScenes.push({ scene, mode, application });\n });\n }\n update() {\n for (const id of this.waitRemoveIds) {\n this.containerManager.removeContainer(id);\n }\n this.waitRemoveIds = [];\n\n for (const sceneInfo of this.waitChangeScenes) {\n this.ensureSceneContainer(sceneInfo.scene);\n const container = this.containerManager.getContainer(sceneInfo.scene.id);\n if (container) {\n sceneInfo.application.stage.removeChildren();\n sceneInfo.application.stage.addChild(container);\n }\n }\n this.waitChangeScenes = [];\n }\n ensureSceneContainer(scene: Scene) {\n if (this.containerManager.getContainer(scene.id)) return;\n const container = new Container();\n container.label = scene.name;\n this.containerManager.addContainer({\n name: scene.id,\n container,\n });\n }\n ensureContainer(gameObject: GameObject, transform: Transform2D) {\n if (this.containerManager.getContainer(gameObject.id)) {\n transform.worldTransform = this.containerManager.getContainer(gameObject.id)\n .worldTransform as unknown as Transform2D['worldTransform'];\n return;\n }\n const container = new Container();\n container.label = gameObject.name;\n this.containerManager.addContainer({\n name: gameObject.id,\n container,\n });\n transform.worldTransform = container.worldTransform as unknown as Transform2D['worldTransform'];\n }\n componentChanged(changed: ComponentChanged) {\n if (changed.componentName === 'GameObject') {\n this.reparent(changed.gameObject);\n return;\n }\n if (changed.componentName !== 'Transform2D') return;\n if (changed.type === OBSERVER_TYPE.ADD) {\n this.ensureContainer(changed.gameObject, changed.component as Transform2D);\n this.reparent(changed.gameObject);\n } else if (changed.type === OBSERVER_TYPE.REMOVE) {\n this.waitRemoveIds.push(changed.gameObject.id);\n }\n }\n reparent(gameObject?: GameObject) {\n if (!gameObject) return;\n const container = this.containerManager.getContainer(gameObject.id);\n if (!container) return;\n if (gameObject.parent) {\n const parentContainer = this.containerManager.getContainer(gameObject.parent.id);\n if (parentContainer && container.parent !== parentContainer) {\n parentContainer.addChild(container);\n }\n const render = gameObject.parent.getComponent('Render') as unknown as RenderSortDirty;\n if (render) {\n render.sortDirty = true;\n }\n } else if (container.parent) {\n const transform = gameObject.getComponent(Transform2D);\n if (transform) {\n delete transform.worldTransform;\n }\n container.parent.removeChild(container);\n }\n }\n destroy() {\n this.removeAllListeners();\n this.waitRemoveIds = null;\n this.waitChangeScenes = null;\n this.system = null;\n this.containerManager = null;\n }\n}\n","/**\n * Inspired by PixiJS v6\n */\nexport type CompressedTextureExtensions = {\n s3tc?: WEBGL_compressed_texture_s3tc,\n s3tc_sRGB: WEBGL_compressed_texture_s3tc_srgb,\n etc: WEBGL_compressed_texture_etc,\n etc1: WEBGL_compressed_texture_etc1,\n pvrtc: WEBKIT_WEBGL_compressed_texture_pvrtc,\n atc: WEBGL_compressed_texture_atc,\n astc: WEBGL_compressed_texture_astc\n};\nexport type CompressedTextureExtensionRef = keyof CompressedTextureExtensions;\nlet result = undefined;\nexport interface SuportedCompressedTexture {\n s3tc: boolean,\n etc: boolean,\n etc1: boolean,\n pvrtc: boolean,\n atc: boolean,\n astc: boolean,\n}\nexport function getSuportCompressedTextureFormats(gl: WebGLRenderingContext): SuportedCompressedTexture {\n if (result) return result;\n\n if (!gl) {\n // #if _DEBUG\n console.warn('WebGL not available for compressed textures. Silently failing.');\n // #endif\n\n return {\n s3tc: false,\n etc: false,\n etc1: false,\n pvrtc: false,\n atc: false,\n astc: false,\n };\n }\n\n result = {\n s3tc: !!gl.getExtension('WEBGL_compressed_texture_s3tc'),\n etc: !!gl.getExtension('WEBGL_compressed_texture_etc'),\n etc1: !!gl.getExtension('WEBGL_compressed_texture_etc1'),\n pvrtc: !!gl.getExtension('WEBGL_compressed_texture_pvrtc')\n || !!gl.getExtension('WEBKIT_WEBGL_compressed_texture_pvrtc'),\n atc: !!gl.getExtension('WEBGL_compressed_texture_atc'),\n astc: !!gl.getExtension('WEBGL_compressed_texture_astc')\n };\n\n try {\n console.log('Supported compressed texture formats: ' + Object.keys(result).filter((type) => result[type]).join(', '))\n } catch (e) { }\n return result;\n}","import type { ApplicationOptions } from 'pixi.js';\nimport type { RenderQualityInput, ResolvedRenderQuality } from '@combos-fun/engine';\n\n/** Pixi init options with engine-only quality fields removed. */\nexport function pixiRenderOptions(\n params: Partial<ApplicationOptions> & RenderQualityInput = {},\n quality: ResolvedRenderQuality,\n): Partial<ApplicationOptions> {\n const {\n maxPixelRatio: _maxPixelRatio,\n adaptivePixelRatio: _adaptivePixelRatio,\n pauseWhenHidden: _pauseWhenHidden,\n pixelRatio: _pixelRatio,\n devicePixelRatio: _devicePixelRatio,\n ...rest\n } = params;\n return {\n ...rest,\n resolution: quality.pixelRatio,\n autoDensity: quality.autoDensity,\n antialias: quality.antialias,\n ...(quality.powerPreference === 'default' ? {} : { powerPreference: quality.powerPreference }),\n autoStart: true,\n sharedTicker: true,\n };\n}\n","import { System, decorators, Game, LOAD_SCENE_MODE, PureObserverInfo, AdaptivePixelRatio, resolveRenderQuality, shouldPauseRendering, fitOrthographicDisplay } from '@combos-fun/engine';\nimport type { OrthographicDisplayFrame, RenderQualityInput, ResolvedRenderQuality, UpdateParams } from '@combos-fun/engine';\nimport { Application } from '@combos-fun/renderer-adapter';\nimport RendererManager from './manager/RendererManager';\nimport ContainerManager from './manager/ContainerManager';\nimport PixiHierarchy from './PixiHierarchy';\nimport Transform2D from './Transform2D';\nimport { Ticker } from 'pixi.js';\nimport type { ApplicationOptions } from 'pixi.js';\nimport type { WebGLRenderer } from 'pixi.js';\nimport { registerCompressedTexture } from './compressedTexture';\nimport { SuportedCompressedTexture, getSuportCompressedTextureFormats } from './compressedTexture/ability';\nimport { pixiRenderOptions } from './renderOptions';\n\nexport enum RENDERER_TYPE {\n UNKNOWN = 0,\n WEBGL = 1,\n CANVAS = 2,\n}\n\n@decorators.componentObserver({\n GameObject: ['parent'],\n Transform2D: [],\n})\nexport default class Renderer extends System<Partial<ApplicationOptions> & RenderQualityInput> {\n static systemName: string = 'Renderer';\n params: Partial<ApplicationOptions> & RenderQualityInput;\n rendererManager: RendererManager;\n containerManager: ContainerManager;\n application: Application | null = null;\n game: Game;\n hierarchy: PixiHierarchy;\n multiApps: Application[] = [];\n suportedCompressedTextureFormats: SuportedCompressedTexture;\n private quality: ResolvedRenderQuality | null = null;\n private adaptive: AdaptivePixelRatio | null = null;\n private viewWidth = 0;\n private viewHeight = 0;\n private pixelRatio = 1;\n private resizeObserver: ResizeObserver | null = null;\n private viewListeners = new Set<(frame: OrthographicDisplayFrame) => void>();\n displayFrame: OrthographicDisplayFrame | null = null;\n\n async init(params?: Partial<ApplicationOptions> & RenderQualityInput) {\n this.params = params ?? {};\n this.quality = resolveRenderQuality(this.params, { adaptivePixelRatio: false });\n this.pixelRatio = this.quality.pixelRatio;\n this.adaptive = new AdaptivePixelRatio({\n pixelRatio: this.quality.pixelRatio,\n ceiling: this.quality.pixelRatioCeiling,\n enabled: this.quality.adaptivePixelRatio,\n });\n const app = await this.createApplication(this.params);\n this.rememberView(app);\n this.application = app;\n this.game.canvas = app.canvas;\n this.observeCanvas(app.canvas);\n this.containerManager = new ContainerManager();\n this.rendererManager = new RendererManager({\n game: this.game,\n rendererSystem: this,\n });\n\n this.hierarchy = new PixiHierarchy({\n system: this,\n containerManager: this.containerManager,\n });\n this.game.on('sceneChanged', async ({ scene, mode, params: sceneParams }) => {\n let application: Application | null = this.application;\n if (mode === LOAD_SCENE_MODE.MULTI_CANVAS) {\n application = await this.createApplication(sceneParams);\n this.multiApps.push(application);\n }\n if (!application) {\n return;\n }\n scene.canvas = application.canvas;\n this.hierarchy.ensureSceneContainer(scene);\n this.hierarchy.emit('changeScene', {\n scene,\n mode,\n application,\n });\n });\n\n const gl = (app.renderer as WebGLRenderer).gl;\n if (gl) {\n this.suportedCompressedTextureFormats = getSuportCompressedTextureFormats(gl);\n registerCompressedTexture(gl);\n }\n }\n\n registerObserver(observerInfo: PureObserverInfo): void {\n const Ctor = this.constructor as typeof Renderer & { observerInfo: PureObserverInfo };\n if (!Ctor.observerInfo) {\n Ctor.observerInfo = {} as PureObserverInfo;\n }\n const thisObserverInfo = Ctor.observerInfo;\n for (const key in observerInfo) {\n if (!thisObserverInfo[key]) {\n thisObserverInfo[key] = [];\n }\n thisObserverInfo[key].push(...observerInfo[key]);\n }\n }\n\n private async createApplication(params: Partial<ApplicationOptions> & RenderQualityInput = {}): Promise<Application> {\n const quality = resolveRenderQuality(params, { adaptivePixelRatio: false });\n const callerPreference = params.preference;\n const initOptions = pixiRenderOptions(params, quality);\n initOptions.preference = callerPreference ?? ['webgpu', 'webgl'];\n\n const app = new Application();\n try {\n await app.init(initOptions);\n } catch {\n if (callerPreference == null) {\n try {\n await app.init({ ...initOptions, preference: 'webgl' });\n } catch {\n await app.init({ ...initOptions, preference: 'canvas' });\n }\n } else {\n await app.init({ ...initOptions, preference: 'canvas' });\n }\n }\n\n Ticker.shared.stop();\n Ticker.shared.autoStart = false;\n\n return app;\n }\n\n update() {\n const changes = this.componentObserver.clear();\n for (const changed of changes) {\n if (changed.componentName === 'GameObject' && changed.gameObject) {\n this.ensureTransform2D(changed.gameObject);\n if (changed.gameObject.parent) this.ensureTransform2D(changed.gameObject.parent);\n }\n this.hierarchy.componentChanged(changed);\n }\n if (!this.application) {\n return;\n }\n for (const gameObject of this.game.gameObjects) {\n const transform = gameObject.getComponent(Transform2D);\n if (transform) {\n this.containerManager.updateTransform({\n name: gameObject.id,\n transform,\n parentSize: gameObject.parent?.getComponent(Transform2D)?.size,\n });\n }\n this.rendererManager.update(gameObject);\n }\n }\n\n private ensureTransform2D(gameObject: Game['gameObjects'][number]) {\n if (!gameObject || gameObject.destroyed || gameObject === gameObject.scene) return;\n let transform = gameObject.getComponent(Transform2D);\n if (!transform) {\n transform = gameObject.addComponent(new Transform2D());\n }\n if (!transform) return;\n this.hierarchy.ensureContainer(gameObject, transform);\n this.hierarchy.reparent(gameObject);\n }\n\n lateUpdate(e: UpdateParams) {\n if (!this.application) {\n return;\n }\n this.hierarchy.update();\n if (shouldPauseRendering(this.quality?.pauseWhenHidden !== false)) return;\n const next = this.adaptive?.sample(e?.deltaTime ?? 0);\n if (next != null) {\n this.pixelRatio = next;\n this.applyDisplay();\n }\n this.application.ticker.update(e.time);\n }\n\n onDisplayFrame(listener: (frame: OrthographicDisplayFrame) => void): () => void {\n this.viewListeners.add(listener);\n if (this.displayFrame) listener(this.displayFrame);\n return () => {\n this.viewListeners.delete(listener);\n };\n }\n\n private observeCanvas(canvas: HTMLCanvasElement) {\n this.resizeObserver?.disconnect();\n if (typeof ResizeObserver !== 'undefined') {\n this.resizeObserver = new ResizeObserver(() => this.applyDisplay());\n this.resizeObserver.observe(canvas);\n }\n this.applyDisplay();\n }\n\n private applyDisplay() {\n const app = this.application;\n const canvas = app?.canvas;\n if (!app || !canvas || this.viewWidth <= 0 || this.viewHeight <= 0) return;\n if (typeof canvas.getBoundingClientRect !== 'function') return;\n const box = canvas.getBoundingClientRect();\n const frame = fitOrthographicDisplay({\n box: { width: box.width, height: box.height },\n width: this.viewWidth,\n height: this.viewHeight,\n resolution: this.pixelRatio,\n });\n if (!frame) return;\n const current = this.displayFrame;\n if (\n current\n && current.bufferWidth === frame.bufferWidth\n && current.bufferHeight === frame.bufferHeight\n && Math.abs(current.originX - frame.originX) < 1e-4\n && Math.abs(current.visibleWidth - frame.visibleWidth) < 1e-4\n ) {\n return;\n }\n app.renderer.resize(frame.visibleWidth, frame.visibleHeight, frame.pixelRatio);\n app.stage.position.set(-frame.originX, -frame.originY);\n this.displayFrame = frame;\n for (const listener of this.viewListeners) listener(frame);\n }\n\n private rememberView(app: Application) {\n const width = this.params?.width || app.renderer?.screen?.width || 0;\n const height = this.params?.height || app.renderer?.screen?.height || 0;\n if (width) this.viewWidth = width;\n if (height) this.viewHeight = height;\n }\n\n onDestroy() {\n this.resizeObserver?.disconnect();\n this.resizeObserver = null;\n this.viewListeners.clear();\n this.displayFrame = null;\n this.application?.destroy();\n for (const app of this.multiApps) {\n app && app.destroy();\n }\n this.hierarchy.destroy();\n this.hierarchy = null;\n this.params = null;\n this.rendererManager = null;\n this.containerManager = null;\n this.application = null;\n this.game = null;\n this.multiApps = null;\n }\n\n resize(width, height) {\n if (!this.application) {\n return;\n }\n this.params = { ...this.params, width, height };\n this.viewWidth = width;\n this.viewHeight = height;\n this.displayFrame = null;\n this.applyDisplay();\n }\n}\n","/** Auto-generated by scripts/build-package.mjs — do not edit. */\n\nimport Renderer from './System';\n\nObject.assign(Renderer, {\n packageName: \"@combos-fun/plugin-renderer\",\n packageVersion: \"0.1.24\",\n});\n","/* eslint-disable @typescript-eslint/no-unused-vars */\n\nimport { GameObject, Game, PureObserverInfo, ComponentChanged, System, UpdateParams } from '@combos-fun/engine';\nimport ContainerManager from './manager/ContainerManager';\nimport RendererManager from './manager/RendererManager';\n\nexport default class Renderer<T extends {} = {}> extends System<T> {\n /**\n * Renderer name\n */\n name: string;\n\n /**\n * currentGame\n */\n game: Game;\n\n /**\n * observer component props info\n */\n static observerInfo: PureObserverInfo;\n\n /**\n * observer component props info\n */\n observerInfo: PureObserverInfo;\n\n /**\n * containerManager\n */\n containerManager: ContainerManager;\n rendererManager: RendererManager;\n\n constructor(params?: T) {\n super(params);\n const Ctor = this.constructor as typeof Renderer & { observerInfo: PureObserverInfo };\n this.observerInfo = Ctor.observerInfo;\n }\n\n // init(arg?: any): void;\n\n /**\n * Called when an observed component property changes.\n */\n componentChanged(_changed: ComponentChanged) { }\n\n /**\n * Called every frame.\n * @param _gameObject gameObject\n */\n rendererUpdate(_gameObject: GameObject) { }\n\n override update(e?: UpdateParams): void {\n const changes = this.componentObserver.clear();\n for (const changed of changes) {\n this.componentChanged(changed);\n }\n }\n\n protected asyncIdMap: Record<number, number> = {}\n\n protected increaseAsyncId(id: number) {\n this.asyncIdMap[id] = (this.asyncIdMap[id] || 0) + 1;\n return this.asyncIdMap[id];\n }\n\n protected validateAsyncId(id: number, asyncId: number) {\n return this.asyncIdMap[id] === asyncId;\n }\n}\n","import { compressedTextureUrl, imageFallbackUrl, RESOURCE_TYPE, resource } from '@combos-fun/engine';\nimport type { ResourceStruct } from '@combos-fun/engine';\nimport { CompressedSource, Texture, getSupportedTextureFormats, loadKTX2onWorker } from 'pixi.js';\nimport type { TEXTURE_FORMATS } from 'pixi.js';\n\n/** Compressed targets only. RGBA is omitted so Basis is never expanded to uncompressed pixels. */\nconst COMPRESSED_TARGETS = [\n 'astc-4x4-unorm',\n 'bc7-rgba-unorm',\n 'bc3-rgba-unorm',\n 'etc2-rgba8unorm',\n] as const satisfies readonly TEXTURE_FORMATS[];\n\nfunction asArrayBuffer(data: unknown): ArrayBuffer | null {\n if (data instanceof ArrayBuffer) return data;\n if (ArrayBuffer.isView(data)) {\n const view = data as ArrayBufferView;\n return view.buffer.slice(view.byteOffset, view.byteOffset + view.byteLength) as ArrayBuffer;\n }\n return null;\n}\n\nfunction loadHtmlImage(url: string): Promise<HTMLImageElement> {\n return new Promise((resolve, reject) => {\n const image = new Image();\n image.crossOrigin = 'anonymous';\n image.onload = () => resolve(image);\n image.onerror = () => reject(new Error(`Failed to load image ${url}`));\n image.src = url;\n });\n}\n\nasync function textureFromElement(image: HTMLImageElement): Promise<Texture> {\n if (typeof createImageBitmap !== 'function') return Texture.from(image);\n let bitmap: ImageBitmap | null = null;\n try {\n bitmap = await createImageBitmap(image);\n return Texture.from(bitmap);\n } catch {\n try {\n bitmap?.close();\n } catch {\n // ImageBitmap.close throws once the bitmap is already detached.\n }\n return Texture.from(image);\n }\n}\n\nasync function loadPixiKtx2(url: string): Promise<Texture | null> {\n try {\n const supported = await getSupportedTextureFormats();\n const compressed = COMPRESSED_TARGETS.filter((format) => supported.includes(format));\n if (!compressed.length) return null;\n const options = await loadKTX2onWorker(url, compressed);\n if (!options?.resource || !COMPRESSED_TARGETS.includes(options.format as typeof COMPRESSED_TARGETS[number])) {\n return null;\n }\n return new Texture({ source: new CompressedSource(options) });\n } catch {\n return null;\n }\n}\n\nasync function loadCompressed(res: ResourceStruct, imageData: unknown): Promise<Texture | null> {\n const buffer = asArrayBuffer(imageData);\n if (!buffer) return null;\n const url = compressedTextureUrl(res.src?.image);\n const blobUrl = URL.createObjectURL(new Blob([buffer]));\n try {\n const texture = await loadPixiKtx2(blobUrl);\n if (texture) return texture;\n } finally {\n URL.revokeObjectURL(blobUrl);\n }\n if (!url) return null;\n return loadPixiKtx2(url);\n}\n\n/** Build the shared 2D texture. KTX2 bytes are transcoded; a raster element is uploaded as-is. */\nexport async function createImageTexture(res: ResourceStruct): Promise<Texture | undefined> {\n const imageData = res.data?.image;\n const compressed = await loadCompressed(res, imageData);\n if (compressed) return compressed;\n if (typeof HTMLImageElement !== 'undefined' && imageData instanceof HTMLImageElement) {\n return textureFromElement(imageData);\n }\n const fallback = imageFallbackUrl(res.src?.image);\n if (!fallback) return undefined;\n try {\n return textureFromElement(await loadHtmlImage(fallback));\n } catch {\n return undefined;\n }\n}\n\n/** Texture already built for this resource. Falls back to a raster element when no instance exists. */\nexport function imageResourceTexture(res: ResourceStruct | null | undefined): Texture | undefined {\n if (res?.instance instanceof Texture) return res.instance;\n const image = res?.data?.image;\n if (typeof HTMLImageElement !== 'undefined' && image instanceof HTMLImageElement) {\n return Texture.from(image);\n }\n return undefined;\n}\n\nexport function releaseImageTexture(texture: Texture) {\n const source = texture.source?.resource;\n texture.destroy(true);\n if (typeof ImageBitmap !== 'undefined' && source instanceof ImageBitmap) {\n try {\n source.close();\n } catch {\n // Already closed by the texture source.\n }\n }\n}\n\nresource.registerInstance(RESOURCE_TYPE.IMAGE, async (res) => createImageTexture(res));\nresource.registerDestroy(RESOURCE_TYPE.IMAGE, ({ instance }) => {\n if (!instance || instance === Texture.EMPTY) return;\n releaseImageTexture(instance as Texture);\n});\n","import RendererSystem, { RENDERER_TYPE } from './System';\nimport RendererManager from './manager/RendererManager';\nimport ContainerManager from './manager/ContainerManager';\nimport Renderer from './Renderer';\nimport Transform2D from './Transform2D';\nimport { createImageTexture, imageResourceTexture, releaseImageTexture } from './imageTexture';\n\n/** Shared resource cache key separator used across renderer plugins */\nexport const RESOURCE_KEY_SPLIT = '_s|r|c_';\n\nexport type { Transform2DParams, TransformMatrix } from './Transform2D';\nexport { RendererManager, ContainerManager, RendererSystem, RENDERER_TYPE, Renderer, Transform2D };\nexport { createImageTexture, imageResourceTexture, releaseImageTexture };\n\n"],"names":["OBSERVER_TYPE","isEqual","Component","__decorate","Field","PixiHierarchy","EventEmitter","Container","decorators","RENDERER_TYPE","Renderer","System","resolveRenderQuality","AdaptivePixelRatio","LOAD_SCENE_MODE","Application","Ticker","shouldPauseRendering","fitOrthographicDisplay","Texture","getSupportedTextureFormats","loadKTX2onWorker","CompressedSource","compressedTextureUrl","imageFallbackUrl","resource","RESOURCE_TYPE"],"mappings":";;;;;;;;;;;;;;;AAKA,MAAM,eAAe,CAAA;AAGnB,IAAA,WAAA,CAAY,EAAE,IAAI,EAAE,cAAc,EAAE,EAAA;QAIpC,IAAA,CAAA,SAAS,GAAe,EAAE;AAHxB,QAAA,IAAI,CAAC,IAAI,GAAG,IAAI;AAChB,QAAA,IAAI,CAAC,cAAc,GAAG,cAAc;IACtC;IAEA,QAAQ,CAAC,GAAG,SAAqB,EAAA;AAC/B,QAAA,KAAK,MAAM,QAAQ,IAAI,SAAS,EAAE;AAChC,YAAA,QAAQ,CAAC,IAAI,GAAG,IAAI,CAAC,IAAI;YACzB,QAAQ,CAAC,eAAe,GAAG,IAAI,CAAC,cAAc,CAAC,eAAe;YAC9D,QAAQ,CAAC,gBAAgB,GAAG,IAAI,CAAC,cAAc,CAAC,gBAAgB;AAChE,YAAA,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,QAAQ,CAAC;QAC/B;IACF;AACA,IAAA,gBAAgB,CAAC,OAA2B,EAAA;AAC1C,QAAA,KAAK,MAAM,OAAO,IAAI,OAAO,EAAE;AAC7B,YAAA,KAAK,MAAM,QAAQ,IAAI,IAAI,CAAC,SAAS,EAAE;gBACrC,MAAM,KAAK,GAAG,QAAQ,CAAC,YAAY,CAAC,OAAO,CAAC,aAAa,C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,GAAG,CAAC,CAAC;AACtFD,eAAQ,CAAC,eAAe,CAACC,oBAAa,CAAC,KAAK,EAAE,CAAC,EAAE,QAAQ,EAAE,KAAI;AAC7D,IAAA,IAAI,CAAC,QAAQ,IAAI,QAAQ,KAAKP,eAAO,CAAC,KAAK;QAAE;IAC7C,mBAAmB,CAAC,QAAmB,CAAC;AAC1C,CAAC,CAAC;;AClHF;AACO,MAAM,kBAAkB,GAAG;;;;;;;;;;;;"}
@@ -1 +1 @@
1
- "use strict";var e=require("tslib"),t=require("@combos-fun/engine"),r=require("@combos-fun/renderer-adapter"),n=require("lodash-es/isEqual"),i=require("eventemitter3"),a=require("@combos-fun/inspector-decorator"),o=require("pixi.js");function s(e){return e&&e.__esModule?e:{default:e}}var c=s(n),p=s(i);class h{constructor({game:e,rendererSystem:t}){this.renderers=[],this.game=e,this.rendererSystem=t}register(...e){for(const t of e)t.game=this.game,t.rendererManager=this.rendererSystem.rendererManager,t.containerManager=this.rendererSystem.containerManager,this.renderers.push(t)}componentChanged(e){for(const r of e)for(const e of this.renderers){const n=e.observerInfo[r.componentName];if(n){if([t.OBSERVER_TYPE.ADD,t.OBSERVER_TYPE.REMOVE].indexOf(r.type)>-1){try{e.componentChanged&&e.componentChanged(r)}catch(e){console.error(`gameObject: ${r.gameObject.name}, ${r.componentName} is error.`,r,e)}continue}if(n.findIndex(e=>c.default(e,r.prop))>-1)try{e.componentChanged&&e.componentChanged(r)}catch(e){console.error(`gameObject: ${r.gameObject&&r.gameObject.name}, ${r.componentName} is componentChanged error.`,r,e)}}}}update(e){for(const t of e.components)for(const r of this.renderers){const n=[];if(r.observerInfo[t.name]&&-1===n.indexOf(e)){n.push(e);try{r.rendererUpdate&&r.rendererUpdate(e)}catch(r){console.info(`gameObject: ${e.name}, ${t.name} is update error`,r)}}}}}class d{constructor(){this.containerMap={}}addContainer({name:e,container:t}){this.containerMap[e]=t}getContainer(e){return this.containerMap[e]}removeContainer(e){this.containerMap[e]?.destroy({children:!0}),delete this.containerMap[e]}updateTransform({name:e,transform:t,parentSize:r}){const n=this.containerMap[e];if(!n||!t)return;const{anchor:i,origin:a,position:o,rotation:s,scale:c,size:p,skew:h}=t;n.rotation=s,n.scale=c,n.pivot.x=p.width*a.x,n.pivot.y=p.height*a.y,n.skew=h;let d=o.x,l=o.y;r&&(d+=r.width*i.x,l+=r.height*i.y),n.position={x:d,y:l}}}class l extends t.Component{constructor(){super(...arguments),this.name="Transform2D",this.position={x:0,y:0},this.size={width:0,height:0},this.origin={x:0,y:0},this.anchor={x:0,y:0},this.scale={x:1,y:1},this.skew={x:0,y:0},this.rotation=0}static{this.componentName="Transform2D"}init(e={}){const t=["position","size","origin","anchor","scale","skew"];for(const r of t)Object.assign(this[r],e[r]);this.rotation=e.rotation??this.rotation}}e.__decorate([a.Field({type:"vector2",step:1,group:"Transform2D",label:"Position",description:"Position on the design canvas (x right, y down)."})],l.prototype,"position",void 0),e.__decorate([a.Field({type:"size",step:1,min:0,group:"Transform2D",label:"Size",description:"Width and height of the object in design pixels."})],l.prototype,"size",void 0),e.__decorate([a.Field({type:"vector2",step:.1,group:"Transform2D",label:"Origin",description:"Local origin used for layout math."})],l.prototype,"origin",void 0),e.__decorate([a.Field({type:"vector2",step:.1,group:"Transform2D",label:"Anchor",description:"Anchor point (0–1) used when positioning and scaling."})],l.prototype,"anchor",void 0),e.__decorate([a.Field({type:"vector2",step:.1,group:"Transform2D",label:"Scale",description:"Scale multipliers on X and Y (1 = original size)."})],l.prototype,"scale",void 0),e.__decorate([a.Field({type:"vector2",step:.1,group:"Transform2D",label:"Skew",description:"Skew amounts on X and Y."})],l.prototype,"skew",void 0),e.__decorate([a.Field({type:"number",step:.1,group:"Transform2D",label:"Rotation",description:"Rotation in radians.",editor:"number-stepper"})],l.prototype,"rotation",void 0);let m=class extends p.default{constructor({system:e,containerManager:t}){super(),this.name="PixiHierarchy",this.waitRemoveIds=[],this.waitChangeScenes=[],this.containerManager=t,this.init(e)}init(e){this.system=e,this.on("changeScene",({scene:e,mode:t,application:r})=>{this.waitChangeScenes.push({scene:e,mode:t,application:r})})}update(){for(const e of this.waitRemoveIds)this.containerManager.removeContainer(e);this.waitRemoveIds=[];for(const e of this.waitChangeScenes){this.ensureSceneContainer(e.scene);const t=this.containerManager.getContainer(e.scene.id);t&&(e.application.stage.removeChildren(),e.application.stage.addChild(t))}this.waitChangeScenes=[]}ensureSceneContainer(e){if(this.containerManager.getContainer(e.id))return;const t=new r.Container;t.label=e.name,this.containerManager.addContainer({name:e.id,container:t})}ensureContainer(e,t){if(this.containerManager.getContainer(e.id))return void(t.worldTransform=this.containerManager.getContainer(e.id).worldTransform);const n=new r.Container;n.label=e.name,this.containerManager.addContainer({name:e.id,container:n}),t.worldTransform=n.worldTransform}componentChanged(e){"GameObject"!==e.componentName?"Transform2D"===e.componentName&&(e.type===t.OBSERVER_TYPE.ADD?(this.ensureContainer(e.gameObject,e.component),this.reparent(e.gameObject)):e.type===t.OBSERVER_TYPE.REMOVE&&this.waitRemoveIds.push(e.gameObject.id)):this.reparent(e.gameObject)}reparent(e){if(!e)return;const t=this.containerManager.getContainer(e.id);if(t)if(e.parent){const r=this.containerManager.getContainer(e.parent.id);r&&t.parent!==r&&r.addChild(t);const n=e.parent.getComponent("Render");n&&(n.sortDirty=!0)}else if(t.parent){const r=e.getComponent(l);r&&delete r.worldTransform,t.parent.removeChild(t)}}destroy(){this.removeAllListeners(),this.waitRemoveIds=null,this.waitChangeScenes=null,this.system=null,this.containerManager=null}};m=e.__decorate([t.decorators.componentObserver({GameObject:["parent"],Transform2D:[]})],m);var u=m;let g;var f;exports.RENDERER_TYPE=void 0,(f=exports.RENDERER_TYPE||(exports.RENDERER_TYPE={}))[f.UNKNOWN=0]="UNKNOWN",f[f.WEBGL=1]="WEBGL",f[f.CANVAS=2]="CANVAS";let y=class extends t.System{constructor(){super(...arguments),this.application=null,this.multiApps=[],this.quality=null,this.adaptive=null,this.viewWidth=0,this.viewHeight=0}static{this.systemName="Renderer"}async init(e){this.params=e??{},this.quality=t.resolveRenderQuality(this.params,{adaptivePixelRatio:!1}),this.adaptive=new t.AdaptivePixelRatio({pixelRatio:this.quality.pixelRatio,ceiling:this.quality.pixelRatioCeiling,enabled:this.quality.adaptivePixelRatio});const r=await this.createApplication(this.params);this.rememberView(r),this.application=r,this.game.canvas=r.canvas,this.containerManager=new d,this.rendererManager=new h({game:this.game,rendererSystem:this}),this.hierarchy=new u({system:this,containerManager:this.containerManager}),this.game.on("sceneChanged",async({scene:e,mode:r,params:n})=>{let i=this.application;r===t.LOAD_SCENE_MODE.MULTI_CANVAS&&(i=await this.createApplication(n),this.multiApps.push(i)),i&&(e.canvas=i.canvas,this.hierarchy.ensureSceneContainer(e),this.hierarchy.emit("changeScene",{scene:e,mode:r,application:i}))});const n=r.renderer.gl;n&&(this.suportedCompressedTextureFormats=function(e){if(g)return g;if(!e)return console.warn("WebGL not available for compressed textures. Silently failing."),{s3tc:!1,etc:!1,etc1:!1,pvrtc:!1,atc:!1,astc:!1};g={s3tc:!!e.getExtension("WEBGL_compressed_texture_s3tc"),etc:!!e.getExtension("WEBGL_compressed_texture_etc"),etc1:!!e.getExtension("WEBGL_compressed_texture_etc1"),pvrtc:!!e.getExtension("WEBGL_compressed_texture_pvrtc")||!!e.getExtension("WEBKIT_WEBGL_compressed_texture_pvrtc"),atc:!!e.getExtension("WEBGL_compressed_texture_atc"),astc:!!e.getExtension("WEBGL_compressed_texture_astc")};try{console.log("Supported compressed texture formats: "+Object.keys(g).filter(e=>g[e]).join(", "))}catch(e){}return g}(n))}registerObserver(e){const t=this.constructor;t.observerInfo||(t.observerInfo={});const r=t.observerInfo;for(const t in e)r[t]||(r[t]=[]),r[t].push(...e[t])}async createApplication(e={}){const n=t.resolveRenderQuality(e,{adaptivePixelRatio:!1}),i=e.preference,a=function(e={},t){const{maxPixelRatio:r,adaptivePixelRatio:n,pauseWhenHidden:i,pixelRatio:a,devicePixelRatio:o,...s}=e;return{...s,resolution:t.pixelRatio,autoDensity:t.autoDensity,antialias:t.antialias,..."default"===t.powerPreference?{}:{powerPreference:t.powerPreference},autoStart:!0,sharedTicker:!0}}(e,n);a.preference=i??["webgpu","webgl"];const s=new r.Application;try{await s.init(a)}catch{if(null==i)try{await s.init({...a,preference:"webgl"})}catch{await s.init({...a,preference:"canvas"})}else await s.init({...a,preference:"canvas"})}return o.Ticker.shared.stop(),o.Ticker.shared.autoStart=!1,s}update(){const e=this.componentObserver.clear();for(const t of e)"GameObject"===t.componentName&&t.gameObject&&(this.ensureTransform2D(t.gameObject),t.gameObject.parent&&this.ensureTransform2D(t.gameObject.parent)),this.hierarchy.componentChanged(t);if(this.application)for(const e of this.game.gameObjects){const t=e.getComponent(l);t&&this.containerManager.updateTransform({name:e.id,transform:t,parentSize:e.parent?.getComponent(l)?.size}),this.rendererManager.update(e)}}ensureTransform2D(e){if(!e||e.destroyed||e===e.scene)return;let t=e.getComponent(l);t||(t=e.addComponent(new l)),t&&(this.hierarchy.ensureContainer(e,t),this.hierarchy.reparent(e))}lateUpdate(e){if(!this.application)return;if(this.hierarchy.update(),t.shouldPauseRendering(!1!==this.quality?.pauseWhenHidden))return;const r=this.adaptive?.sample(e?.deltaTime??0);null!=r&&this.applyPixelRatio(r),this.application.ticker.update(e.time)}rememberView(e){const t=this.params?.width||e.renderer?.screen?.width||0,r=this.params?.height||e.renderer?.screen?.height||0;t&&(this.viewWidth=t),r&&(this.viewHeight=r)}applyPixelRatio(e){const t=this.application?.renderer;t&&e>0&&(t.resolution=e,this.viewWidth>0&&this.viewHeight>0&&t.resize(this.viewWidth,this.viewHeight))}onDestroy(){this.application?.destroy();for(const e of this.multiApps)e&&e.destroy();this.hierarchy.destroy(),this.hierarchy=null,this.params=null,this.rendererManager=null,this.containerManager=null,this.application=null,this.game=null,this.multiApps=null}resize(e,t){this.application&&(this.params={...this.params,width:e,height:t},this.viewWidth=e,this.viewHeight=t,this.application.renderer.resize(e,t))}};y=e.__decorate([t.decorators.componentObserver({GameObject:["parent"],Transform2D:[]})],y);var v=y;Object.assign(v,{packageName:"@combos-fun/plugin-renderer",packageVersion:"0.1.22"});class x extends t.System{constructor(e){super(e),this.asyncIdMap={};const t=this.constructor;this.observerInfo=t.observerInfo}componentChanged(e){}rendererUpdate(e){}update(e){const t=this.componentObserver.clear();for(const e of t)this.componentChanged(e)}increaseAsyncId(e){return this.asyncIdMap[e]=(this.asyncIdMap[e]||0)+1,this.asyncIdMap[e]}validateAsyncId(e,t){return this.asyncIdMap[e]===t}}const w=["astc-4x4-unorm","bc7-rgba-unorm","bc3-rgba-unorm","etc2-rgba8unorm"];async function b(e){if("function"!=typeof createImageBitmap)return o.Texture.from(e);let t=null;try{return t=await createImageBitmap(e),o.Texture.from(t)}catch{try{t?.close()}catch{}return o.Texture.from(e)}}async function E(e){try{const t=await o.getSupportedTextureFormats(),r=w.filter(e=>t.includes(e));if(!r.length)return null;const n=await o.loadKTX2onWorker(e,r);return n?.resource&&w.includes(n.format)?new o.Texture({source:new o.CompressedSource(n)}):null}catch{return null}}async function R(e,r){const n=function(e){if(e instanceof ArrayBuffer)return e;if(ArrayBuffer.isView(e)){const t=e;return t.buffer.slice(t.byteOffset,t.byteOffset+t.byteLength)}return null}(r);if(!n)return null;const i=t.compressedTextureUrl(e.src?.image),a=URL.createObjectURL(new Blob([n]));try{const e=await E(a);if(e)return e}finally{URL.revokeObjectURL(a)}return i?E(i):null}async function C(e){const r=e.data?.image,n=await R(e,r);if(n)return n;if("undefined"!=typeof HTMLImageElement&&r instanceof HTMLImageElement)return b(r);const i=t.imageFallbackUrl(e.src?.image);var a;if(i)try{return b(await(a=i,new Promise((e,t)=>{const r=new Image;r.crossOrigin="anonymous",r.onload=()=>e(r),r.onerror=()=>t(new Error(`Failed to load image ${a}`)),r.src=a})))}catch{return}}function T(e){const t=e.source?.resource;if(e.destroy(!0),"undefined"!=typeof ImageBitmap&&t instanceof ImageBitmap)try{t.close()}catch{}}t.resource.registerInstance(t.RESOURCE_TYPE.IMAGE,async e=>C(e)),t.resource.registerDestroy(t.RESOURCE_TYPE.IMAGE,({instance:e})=>{e&&e!==o.Texture.EMPTY&&T(e)});exports.ContainerManager=d,exports.RESOURCE_KEY_SPLIT="_s|r|c_",exports.Renderer=x,exports.RendererManager=h,exports.RendererSystem=v,exports.Transform2D=l,exports.createImageTexture=C,exports.imageResourceTexture=function(e){if(e?.instance instanceof o.Texture)return e.instance;const t=e?.data?.image;return"undefined"!=typeof HTMLImageElement&&t instanceof HTMLImageElement?o.Texture.from(t):void 0},exports.releaseImageTexture=T;
1
+ "use strict";var e=require("tslib"),t=require("@combos-fun/engine"),r=require("@combos-fun/renderer-adapter"),n=require("lodash-es/isEqual"),i=require("eventemitter3"),s=require("@combos-fun/inspector-decorator"),a=require("pixi.js");function o(e){return e&&e.__esModule?e:{default:e}}var c=o(n),p=o(i);class h{constructor({game:e,rendererSystem:t}){this.renderers=[],this.game=e,this.rendererSystem=t}register(...e){for(const t of e)t.game=this.game,t.rendererManager=this.rendererSystem.rendererManager,t.containerManager=this.rendererSystem.containerManager,this.renderers.push(t)}componentChanged(e){for(const r of e)for(const e of this.renderers){const n=e.observerInfo[r.componentName];if(n){if([t.OBSERVER_TYPE.ADD,t.OBSERVER_TYPE.REMOVE].indexOf(r.type)>-1){try{e.componentChanged&&e.componentChanged(r)}catch(e){console.error(`gameObject: ${r.gameObject.name}, ${r.componentName} is error.`,r,e)}continue}if(n.findIndex(e=>c.default(e,r.prop))>-1)try{e.componentChanged&&e.componentChanged(r)}catch(e){console.error(`gameObject: ${r.gameObject&&r.gameObject.name}, ${r.componentName} is componentChanged error.`,r,e)}}}}update(e){for(const t of e.components)for(const r of this.renderers){const n=[];if(r.observerInfo[t.name]&&-1===n.indexOf(e)){n.push(e);try{r.rendererUpdate&&r.rendererUpdate(e)}catch(r){console.info(`gameObject: ${e.name}, ${t.name} is update error`,r)}}}}}class l{constructor(){this.containerMap={}}addContainer({name:e,container:t}){this.containerMap[e]=t}getContainer(e){return this.containerMap[e]}removeContainer(e){this.containerMap[e]?.destroy({children:!0}),delete this.containerMap[e]}updateTransform({name:e,transform:t,parentSize:r}){const n=this.containerMap[e];if(!n||!t)return;const{anchor:i,origin:s,position:a,rotation:o,scale:c,size:p,skew:h}=t;n.rotation=o,n.scale=c,n.pivot.x=p.width*s.x,n.pivot.y=p.height*s.y,n.skew=h;let l=a.x,d=a.y;r&&(l+=r.width*i.x,d+=r.height*i.y),n.position={x:l,y:d}}}class d extends t.Component{constructor(){super(...arguments),this.name="Transform2D",this.position={x:0,y:0},this.size={width:0,height:0},this.origin={x:0,y:0},this.anchor={x:0,y:0},this.scale={x:1,y:1},this.skew={x:0,y:0},this.rotation=0}static{this.componentName="Transform2D"}init(e={}){const t=["position","size","origin","anchor","scale","skew"];for(const r of t)Object.assign(this[r],e[r]);this.rotation=e.rotation??this.rotation}}e.__decorate([s.Field({type:"vector2",step:1,group:"Transform2D",label:"Position",description:"Position on the design canvas (x right, y down)."})],d.prototype,"position",void 0),e.__decorate([s.Field({type:"size",step:1,min:0,group:"Transform2D",label:"Size",description:"Width and height of the object in design pixels."})],d.prototype,"size",void 0),e.__decorate([s.Field({type:"vector2",step:.1,group:"Transform2D",label:"Origin",description:"Local origin used for layout math."})],d.prototype,"origin",void 0),e.__decorate([s.Field({type:"vector2",step:.1,group:"Transform2D",label:"Anchor",description:"Anchor point (0–1) used when positioning and scaling."})],d.prototype,"anchor",void 0),e.__decorate([s.Field({type:"vector2",step:.1,group:"Transform2D",label:"Scale",description:"Scale multipliers on X and Y (1 = original size)."})],d.prototype,"scale",void 0),e.__decorate([s.Field({type:"vector2",step:.1,group:"Transform2D",label:"Skew",description:"Skew amounts on X and Y."})],d.prototype,"skew",void 0),e.__decorate([s.Field({type:"number",step:.1,group:"Transform2D",label:"Rotation",description:"Rotation in radians.",editor:"number-stepper"})],d.prototype,"rotation",void 0);let m=class extends p.default{constructor({system:e,containerManager:t}){super(),this.name="PixiHierarchy",this.waitRemoveIds=[],this.waitChangeScenes=[],this.containerManager=t,this.init(e)}init(e){this.system=e,this.on("changeScene",({scene:e,mode:t,application:r})=>{this.waitChangeScenes.push({scene:e,mode:t,application:r})})}update(){for(const e of this.waitRemoveIds)this.containerManager.removeContainer(e);this.waitRemoveIds=[];for(const e of this.waitChangeScenes){this.ensureSceneContainer(e.scene);const t=this.containerManager.getContainer(e.scene.id);t&&(e.application.stage.removeChildren(),e.application.stage.addChild(t))}this.waitChangeScenes=[]}ensureSceneContainer(e){if(this.containerManager.getContainer(e.id))return;const t=new r.Container;t.label=e.name,this.containerManager.addContainer({name:e.id,container:t})}ensureContainer(e,t){if(this.containerManager.getContainer(e.id))return void(t.worldTransform=this.containerManager.getContainer(e.id).worldTransform);const n=new r.Container;n.label=e.name,this.containerManager.addContainer({name:e.id,container:n}),t.worldTransform=n.worldTransform}componentChanged(e){"GameObject"!==e.componentName?"Transform2D"===e.componentName&&(e.type===t.OBSERVER_TYPE.ADD?(this.ensureContainer(e.gameObject,e.component),this.reparent(e.gameObject)):e.type===t.OBSERVER_TYPE.REMOVE&&this.waitRemoveIds.push(e.gameObject.id)):this.reparent(e.gameObject)}reparent(e){if(!e)return;const t=this.containerManager.getContainer(e.id);if(t)if(e.parent){const r=this.containerManager.getContainer(e.parent.id);r&&t.parent!==r&&r.addChild(t);const n=e.parent.getComponent("Render");n&&(n.sortDirty=!0)}else if(t.parent){const r=e.getComponent(d);r&&delete r.worldTransform,t.parent.removeChild(t)}}destroy(){this.removeAllListeners(),this.waitRemoveIds=null,this.waitChangeScenes=null,this.system=null,this.containerManager=null}};m=e.__decorate([t.decorators.componentObserver({GameObject:["parent"],Transform2D:[]})],m);var u=m;let g;var f;exports.RENDERER_TYPE=void 0,(f=exports.RENDERER_TYPE||(exports.RENDERER_TYPE={}))[f.UNKNOWN=0]="UNKNOWN",f[f.WEBGL=1]="WEBGL",f[f.CANVAS=2]="CANVAS";let y=class extends t.System{constructor(){super(...arguments),this.application=null,this.multiApps=[],this.quality=null,this.adaptive=null,this.viewWidth=0,this.viewHeight=0,this.pixelRatio=1,this.resizeObserver=null,this.viewListeners=new Set,this.displayFrame=null}static{this.systemName="Renderer"}async init(e){this.params=e??{},this.quality=t.resolveRenderQuality(this.params,{adaptivePixelRatio:!1}),this.pixelRatio=this.quality.pixelRatio,this.adaptive=new t.AdaptivePixelRatio({pixelRatio:this.quality.pixelRatio,ceiling:this.quality.pixelRatioCeiling,enabled:this.quality.adaptivePixelRatio});const r=await this.createApplication(this.params);this.rememberView(r),this.application=r,this.game.canvas=r.canvas,this.observeCanvas(r.canvas),this.containerManager=new l,this.rendererManager=new h({game:this.game,rendererSystem:this}),this.hierarchy=new u({system:this,containerManager:this.containerManager}),this.game.on("sceneChanged",async({scene:e,mode:r,params:n})=>{let i=this.application;r===t.LOAD_SCENE_MODE.MULTI_CANVAS&&(i=await this.createApplication(n),this.multiApps.push(i)),i&&(e.canvas=i.canvas,this.hierarchy.ensureSceneContainer(e),this.hierarchy.emit("changeScene",{scene:e,mode:r,application:i}))});const n=r.renderer.gl;n&&(this.suportedCompressedTextureFormats=function(e){if(g)return g;if(!e)return console.warn("WebGL not available for compressed textures. Silently failing."),{s3tc:!1,etc:!1,etc1:!1,pvrtc:!1,atc:!1,astc:!1};g={s3tc:!!e.getExtension("WEBGL_compressed_texture_s3tc"),etc:!!e.getExtension("WEBGL_compressed_texture_etc"),etc1:!!e.getExtension("WEBGL_compressed_texture_etc1"),pvrtc:!!e.getExtension("WEBGL_compressed_texture_pvrtc")||!!e.getExtension("WEBKIT_WEBGL_compressed_texture_pvrtc"),atc:!!e.getExtension("WEBGL_compressed_texture_atc"),astc:!!e.getExtension("WEBGL_compressed_texture_astc")};try{console.log("Supported compressed texture formats: "+Object.keys(g).filter(e=>g[e]).join(", "))}catch(e){}return g}(n))}registerObserver(e){const t=this.constructor;t.observerInfo||(t.observerInfo={});const r=t.observerInfo;for(const t in e)r[t]||(r[t]=[]),r[t].push(...e[t])}async createApplication(e={}){const n=t.resolveRenderQuality(e,{adaptivePixelRatio:!1}),i=e.preference,s=function(e={},t){const{maxPixelRatio:r,adaptivePixelRatio:n,pauseWhenHidden:i,pixelRatio:s,devicePixelRatio:a,...o}=e;return{...o,resolution:t.pixelRatio,autoDensity:t.autoDensity,antialias:t.antialias,..."default"===t.powerPreference?{}:{powerPreference:t.powerPreference},autoStart:!0,sharedTicker:!0}}(e,n);s.preference=i??["webgpu","webgl"];const o=new r.Application;try{await o.init(s)}catch{if(null==i)try{await o.init({...s,preference:"webgl"})}catch{await o.init({...s,preference:"canvas"})}else await o.init({...s,preference:"canvas"})}return a.Ticker.shared.stop(),a.Ticker.shared.autoStart=!1,o}update(){const e=this.componentObserver.clear();for(const t of e)"GameObject"===t.componentName&&t.gameObject&&(this.ensureTransform2D(t.gameObject),t.gameObject.parent&&this.ensureTransform2D(t.gameObject.parent)),this.hierarchy.componentChanged(t);if(this.application)for(const e of this.game.gameObjects){const t=e.getComponent(d);t&&this.containerManager.updateTransform({name:e.id,transform:t,parentSize:e.parent?.getComponent(d)?.size}),this.rendererManager.update(e)}}ensureTransform2D(e){if(!e||e.destroyed||e===e.scene)return;let t=e.getComponent(d);t||(t=e.addComponent(new d)),t&&(this.hierarchy.ensureContainer(e,t),this.hierarchy.reparent(e))}lateUpdate(e){if(!this.application)return;if(this.hierarchy.update(),t.shouldPauseRendering(!1!==this.quality?.pauseWhenHidden))return;const r=this.adaptive?.sample(e?.deltaTime??0);null!=r&&(this.pixelRatio=r,this.applyDisplay()),this.application.ticker.update(e.time)}onDisplayFrame(e){return this.viewListeners.add(e),this.displayFrame&&e(this.displayFrame),()=>{this.viewListeners.delete(e)}}observeCanvas(e){this.resizeObserver?.disconnect(),"undefined"!=typeof ResizeObserver&&(this.resizeObserver=new ResizeObserver(()=>this.applyDisplay()),this.resizeObserver.observe(e)),this.applyDisplay()}applyDisplay(){const e=this.application,r=e?.canvas;if(!e||!r||this.viewWidth<=0||this.viewHeight<=0)return;if("function"!=typeof r.getBoundingClientRect)return;const n=r.getBoundingClientRect(),i=t.fitOrthographicDisplay({box:{width:n.width,height:n.height},width:this.viewWidth,height:this.viewHeight,resolution:this.pixelRatio});if(!i)return;const s=this.displayFrame;if(!(s&&s.bufferWidth===i.bufferWidth&&s.bufferHeight===i.bufferHeight&&Math.abs(s.originX-i.originX)<1e-4&&Math.abs(s.visibleWidth-i.visibleWidth)<1e-4)){e.renderer.resize(i.visibleWidth,i.visibleHeight,i.pixelRatio),e.stage.position.set(-i.originX,-i.originY),this.displayFrame=i;for(const e of this.viewListeners)e(i)}}rememberView(e){const t=this.params?.width||e.renderer?.screen?.width||0,r=this.params?.height||e.renderer?.screen?.height||0;t&&(this.viewWidth=t),r&&(this.viewHeight=r)}onDestroy(){this.resizeObserver?.disconnect(),this.resizeObserver=null,this.viewListeners.clear(),this.displayFrame=null,this.application?.destroy();for(const e of this.multiApps)e&&e.destroy();this.hierarchy.destroy(),this.hierarchy=null,this.params=null,this.rendererManager=null,this.containerManager=null,this.application=null,this.game=null,this.multiApps=null}resize(e,t){this.application&&(this.params={...this.params,width:e,height:t},this.viewWidth=e,this.viewHeight=t,this.displayFrame=null,this.applyDisplay())}};y=e.__decorate([t.decorators.componentObserver({GameObject:["parent"],Transform2D:[]})],y);var v=y;Object.assign(v,{packageName:"@combos-fun/plugin-renderer",packageVersion:"0.1.24"});class b extends t.System{constructor(e){super(e),this.asyncIdMap={};const t=this.constructor;this.observerInfo=t.observerInfo}componentChanged(e){}rendererUpdate(e){}update(e){const t=this.componentObserver.clear();for(const e of t)this.componentChanged(e)}increaseAsyncId(e){return this.asyncIdMap[e]=(this.asyncIdMap[e]||0)+1,this.asyncIdMap[e]}validateAsyncId(e,t){return this.asyncIdMap[e]===t}}const w=["astc-4x4-unorm","bc7-rgba-unorm","bc3-rgba-unorm","etc2-rgba8unorm"];async function x(e){if("function"!=typeof createImageBitmap)return a.Texture.from(e);let t=null;try{return t=await createImageBitmap(e),a.Texture.from(t)}catch{try{t?.close()}catch{}return a.Texture.from(e)}}async function R(e){try{const t=await a.getSupportedTextureFormats(),r=w.filter(e=>t.includes(e));if(!r.length)return null;const n=await a.loadKTX2onWorker(e,r);return n?.resource&&w.includes(n.format)?new a.Texture({source:new a.CompressedSource(n)}):null}catch{return null}}async function E(e,r){const n=function(e){if(e instanceof ArrayBuffer)return e;if(ArrayBuffer.isView(e)){const t=e;return t.buffer.slice(t.byteOffset,t.byteOffset+t.byteLength)}return null}(r);if(!n)return null;const i=t.compressedTextureUrl(e.src?.image),s=URL.createObjectURL(new Blob([n]));try{const e=await R(s);if(e)return e}finally{URL.revokeObjectURL(s)}return i?R(i):null}async function C(e){const r=e.data?.image,n=await E(e,r);if(n)return n;if("undefined"!=typeof HTMLImageElement&&r instanceof HTMLImageElement)return x(r);const i=t.imageFallbackUrl(e.src?.image);var s;if(i)try{return x(await(s=i,new Promise((e,t)=>{const r=new Image;r.crossOrigin="anonymous",r.onload=()=>e(r),r.onerror=()=>t(new Error(`Failed to load image ${s}`)),r.src=s})))}catch{return}}function T(e){const t=e.source?.resource;if(e.destroy(!0),"undefined"!=typeof ImageBitmap&&t instanceof ImageBitmap)try{t.close()}catch{}}t.resource.registerInstance(t.RESOURCE_TYPE.IMAGE,async e=>C(e)),t.resource.registerDestroy(t.RESOURCE_TYPE.IMAGE,({instance:e})=>{e&&e!==a.Texture.EMPTY&&T(e)});exports.ContainerManager=l,exports.RESOURCE_KEY_SPLIT="_s|r|c_",exports.Renderer=b,exports.RendererManager=h,exports.RendererSystem=v,exports.Transform2D=d,exports.createImageTexture=C,exports.imageResourceTexture=function(e){if(e?.instance instanceof a.Texture)return e.instance;const t=e?.data?.image;return"undefined"!=typeof HTMLImageElement&&t instanceof HTMLImageElement?a.Texture.from(t):void 0},exports.releaseImageTexture=T;
@@ -1,5 +1,5 @@
1
1
  import { Container, Application } from '@combos-fun/renderer-adapter';
2
- import { Component, ComponentParams, System, Game, PureObserverInfo, ComponentChanged, GameObject, UpdateParams, Scene, LOAD_SCENE_MODE, RenderQualityInput, ResourceStruct } from '@combos-fun/engine';
2
+ import { Component, ComponentParams, System, Game, PureObserverInfo, ComponentChanged, GameObject, UpdateParams, Scene, LOAD_SCENE_MODE, RenderQualityInput, OrthographicDisplayFrame, ResourceStruct } from '@combos-fun/engine';
3
3
  import EventEmitter from 'eventemitter3';
4
4
  import { ApplicationOptions, Texture } from 'pixi.js';
5
5
 
@@ -166,14 +166,20 @@ declare class Renderer extends System<Partial<ApplicationOptions> & RenderQualit
166
166
  private adaptive;
167
167
  private viewWidth;
168
168
  private viewHeight;
169
+ private pixelRatio;
170
+ private resizeObserver;
171
+ private viewListeners;
172
+ displayFrame: OrthographicDisplayFrame | null;
169
173
  init(params?: Partial<ApplicationOptions> & RenderQualityInput): Promise<void>;
170
174
  registerObserver(observerInfo: PureObserverInfo): void;
171
175
  private createApplication;
172
176
  update(): void;
173
177
  private ensureTransform2D;
174
178
  lateUpdate(e: UpdateParams): void;
179
+ onDisplayFrame(listener: (frame: OrthographicDisplayFrame) => void): () => void;
180
+ private observeCanvas;
181
+ private applyDisplay;
175
182
  private rememberView;
176
- private applyPixelRatio;
177
183
  onDestroy(): void;
178
184
  resize(width: any, height: any): void;
179
185
  }
@@ -1,5 +1,5 @@
1
1
  import { __decorate } from 'tslib';
2
- import { OBSERVER_TYPE, Component, decorators, System, resolveRenderQuality, AdaptivePixelRatio, LOAD_SCENE_MODE, shouldPauseRendering, resource, RESOURCE_TYPE, imageFallbackUrl, compressedTextureUrl } from '@combos-fun/engine';
2
+ import { OBSERVER_TYPE, Component, decorators, System, resolveRenderQuality, AdaptivePixelRatio, LOAD_SCENE_MODE, shouldPauseRendering, fitOrthographicDisplay, resource, RESOURCE_TYPE, imageFallbackUrl, compressedTextureUrl } from '@combos-fun/engine';
3
3
  import { Container, Application } from '@combos-fun/renderer-adapter';
4
4
  import isEqual from 'lodash-es/isEqual';
5
5
  import EventEmitter from 'eventemitter3';
@@ -361,12 +361,17 @@ let Renderer$1 = class Renderer extends System {
361
361
  this.adaptive = null;
362
362
  this.viewWidth = 0;
363
363
  this.viewHeight = 0;
364
+ this.pixelRatio = 1;
365
+ this.resizeObserver = null;
366
+ this.viewListeners = new Set();
367
+ this.displayFrame = null;
364
368
  }
365
369
  static { }
366
370
  static { this.systemName = 'Renderer'; }
367
371
  async init(params) {
368
372
  this.params = params ?? {};
369
373
  this.quality = resolveRenderQuality(this.params, { adaptivePixelRatio: false });
374
+ this.pixelRatio = this.quality.pixelRatio;
370
375
  this.adaptive = new AdaptivePixelRatio({
371
376
  pixelRatio: this.quality.pixelRatio,
372
377
  ceiling: this.quality.pixelRatioCeiling,
@@ -376,6 +381,7 @@ let Renderer$1 = class Renderer extends System {
376
381
  this.rememberView(app);
377
382
  this.application = app;
378
383
  this.game.canvas = app.canvas;
384
+ this.observeCanvas(app.canvas);
379
385
  this.containerManager = new ContainerManager();
380
386
  this.rendererManager = new RendererManager({
381
387
  game: this.game,
@@ -491,10 +497,58 @@ let Renderer$1 = class Renderer extends System {
491
497
  if (shouldPauseRendering(this.quality?.pauseWhenHidden !== false))
492
498
  return;
493
499
  const next = this.adaptive?.sample(e?.deltaTime ?? 0);
494
- if (next != null)
495
- this.applyPixelRatio(next);
500
+ if (next != null) {
501
+ this.pixelRatio = next;
502
+ this.applyDisplay();
503
+ }
496
504
  this.application.ticker.update(e.time);
497
505
  }
506
+ onDisplayFrame(listener) {
507
+ this.viewListeners.add(listener);
508
+ if (this.displayFrame)
509
+ listener(this.displayFrame);
510
+ return () => {
511
+ this.viewListeners.delete(listener);
512
+ };
513
+ }
514
+ observeCanvas(canvas) {
515
+ this.resizeObserver?.disconnect();
516
+ if (typeof ResizeObserver !== 'undefined') {
517
+ this.resizeObserver = new ResizeObserver(() => this.applyDisplay());
518
+ this.resizeObserver.observe(canvas);
519
+ }
520
+ this.applyDisplay();
521
+ }
522
+ applyDisplay() {
523
+ const app = this.application;
524
+ const canvas = app?.canvas;
525
+ if (!app || !canvas || this.viewWidth <= 0 || this.viewHeight <= 0)
526
+ return;
527
+ if (typeof canvas.getBoundingClientRect !== 'function')
528
+ return;
529
+ const box = canvas.getBoundingClientRect();
530
+ const frame = fitOrthographicDisplay({
531
+ box: { width: box.width, height: box.height },
532
+ width: this.viewWidth,
533
+ height: this.viewHeight,
534
+ resolution: this.pixelRatio,
535
+ });
536
+ if (!frame)
537
+ return;
538
+ const current = this.displayFrame;
539
+ if (current
540
+ && current.bufferWidth === frame.bufferWidth
541
+ && current.bufferHeight === frame.bufferHeight
542
+ && Math.abs(current.originX - frame.originX) < 1e-4
543
+ && Math.abs(current.visibleWidth - frame.visibleWidth) < 1e-4) {
544
+ return;
545
+ }
546
+ app.renderer.resize(frame.visibleWidth, frame.visibleHeight, frame.pixelRatio);
547
+ app.stage.position.set(-frame.originX, -frame.originY);
548
+ this.displayFrame = frame;
549
+ for (const listener of this.viewListeners)
550
+ listener(frame);
551
+ }
498
552
  rememberView(app) {
499
553
  const width = this.params?.width || app.renderer?.screen?.width || 0;
500
554
  const height = this.params?.height || app.renderer?.screen?.height || 0;
@@ -503,16 +557,11 @@ let Renderer$1 = class Renderer extends System {
503
557
  if (height)
504
558
  this.viewHeight = height;
505
559
  }
506
- applyPixelRatio(ratio) {
507
- const renderer = this.application?.renderer;
508
- if (!renderer || !(ratio > 0))
509
- return;
510
- renderer.resolution = ratio;
511
- if (this.viewWidth > 0 && this.viewHeight > 0) {
512
- renderer.resize(this.viewWidth, this.viewHeight);
513
- }
514
- }
515
560
  onDestroy() {
561
+ this.resizeObserver?.disconnect();
562
+ this.resizeObserver = null;
563
+ this.viewListeners.clear();
564
+ this.displayFrame = null;
516
565
  this.application?.destroy();
517
566
  for (const app of this.multiApps) {
518
567
  app && app.destroy();
@@ -533,7 +582,8 @@ let Renderer$1 = class Renderer extends System {
533
582
  this.params = { ...this.params, width, height };
534
583
  this.viewWidth = width;
535
584
  this.viewHeight = height;
536
- this.application.renderer.resize(width, height);
585
+ this.displayFrame = null;
586
+ this.applyDisplay();
537
587
  }
538
588
  };
539
589
  Renderer$1 = __decorate([
@@ -547,7 +597,7 @@ var Renderer$2 = Renderer$1;
547
597
  /** Auto-generated by scripts/build-package.mjs — do not edit. */
548
598
  Object.assign(Renderer$2, {
549
599
  packageName: "@combos-fun/plugin-renderer",
550
- packageVersion: "0.1.22",
600
+ packageVersion: "0.1.24",
551
601
  });
552
602
 
553
603
  /* eslint-disable @typescript-eslint/no-unused-vars */
@@ -1 +1 @@
1
- {"version":3,"file":"plugin-renderer.esm.js","sources":["../lib/manager/RendererManager.ts","../lib/manager/ContainerManager.ts","../lib/Transform2D.ts","../lib/PixiHierarchy.ts","../lib/compressedTexture/ability.ts","../lib/renderOptions.ts","../lib/System.ts","../lib/__combosPackageMeta.gen.ts","../lib/Renderer.ts","../lib/imageTexture.ts","../lib/index.ts"],"sourcesContent":["import isEqual from 'lodash-es/isEqual';\nimport { GameObject, Game, ComponentChanged, OBSERVER_TYPE } from '@combos-fun/engine';\nimport Renderer from '../Renderer';\nimport RendererSystem from '../System';\n\nclass RendererManager {\n game: Game;\n rendererSystem: RendererSystem;\n constructor({ game, rendererSystem }) {\n this.game = game;\n this.rendererSystem = rendererSystem;\n }\n renderers: Renderer[] = [];\n register(...renderers: Renderer[]) {\n for (const renderer of renderers) {\n renderer.game = this.game;\n renderer.rendererManager = this.rendererSystem.rendererManager;\n renderer.containerManager = this.rendererSystem.containerManager;\n this.renderers.push(renderer);\n }\n }\n componentChanged(changes: ComponentChanged[]) {\n for (const changed of changes) {\n for (const renderer of this.renderers) {\n const props = renderer.observerInfo[changed.componentName];\n if (props) {\n if ([OBSERVER_TYPE.ADD, OBSERVER_TYPE.REMOVE].indexOf(changed.type) > -1) {\n try {\n renderer.componentChanged && renderer.componentChanged(changed);\n } catch (e) {\n console.error(`gameObject: ${changed.gameObject.name}, ${changed.componentName} is error.`, changed, e);\n }\n continue;\n }\n\n const index = props.findIndex(prop => {\n return isEqual(prop, changed.prop);\n });\n\n if (index > -1) {\n try {\n renderer.componentChanged && renderer.componentChanged(changed);\n } catch (e) {\n console.error(\n `gameObject: ${changed.gameObject && changed.gameObject.name}, ${\n changed.componentName\n } is componentChanged error.`,\n changed,\n e,\n );\n }\n }\n }\n }\n }\n }\n update(gameObject: GameObject) {\n for (const component of gameObject.components) {\n for (const renderer of this.renderers) {\n const cache = [];\n const props = renderer.observerInfo[component.name];\n if (props && cache.indexOf(gameObject) === -1) {\n cache.push(gameObject);\n try {\n renderer.rendererUpdate && renderer.rendererUpdate(gameObject);\n } catch (e) {\n console.info(`gameObject: ${gameObject.name}, ${component.name} is update error`, e);\n }\n }\n }\n }\n }\n}\nexport default RendererManager;\n","import { Point, ObservablePoint } from 'pixi.js';\nimport { Container } from '@combos-fun/renderer-adapter';\nimport type Transform2D from '../Transform2D';\n\nexport default class ContainerManager {\n containerMap: { [propName: number]: Container } = {};\n addContainer({ name, container }: { name: number; container: Container }) {\n this.containerMap[name] = container;\n }\n getContainer(name: number) {\n return this.containerMap[name];\n }\n removeContainer(name: number) {\n this.containerMap[name]?.destroy({ children: true });\n delete this.containerMap[name];\n }\n updateTransform({\n name,\n transform,\n parentSize,\n }: {\n name: number;\n transform: Transform2D;\n parentSize?: { width: number; height: number };\n }) {\n const container = this.containerMap[name];\n if (!container || !transform) return;\n const { anchor, origin, position, rotation, scale, size, skew } = transform;\n container.rotation = rotation;\n container.scale = scale as Point;\n container.pivot.x = size.width * origin.x;\n container.pivot.y = size.height * origin.y;\n container.skew = skew as ObservablePoint;\n let x = position.x;\n let y = position.y;\n if (parentSize) {\n x = x + parentSize.width * anchor.x;\n y = y + parentSize.height * anchor.y;\n }\n\n container.position = { x, y } as Point;\n }\n}\n","import { Component } from '@combos-fun/engine';\nimport type { ComponentParams } from '@combos-fun/engine';\nimport { Field } from '@combos-fun/inspector-decorator';\n\ninterface Vector2 {\n x: number;\n y: number;\n}\n\ninterface Size2 {\n width: number;\n height: number;\n}\n\nexport interface TransformMatrix {\n a: number;\n b: number;\n c: number;\n d: number;\n tx: number;\n ty: number;\n array?: number[];\n}\n\nexport interface Transform2DParams extends ComponentParams {\n position?: Vector2;\n size?: Size2;\n origin?: Vector2;\n anchor?: Vector2;\n scale?: Vector2;\n skew?: Vector2;\n rotation?: number;\n}\n\n/** 2D layout pose. Hierarchy lives on GameObject. */\nclass Transform2D extends Component<Transform2DParams> {\n static componentName: string = 'Transform2D';\n readonly name: string = 'Transform2D';\n\n worldTransform: TransformMatrix;\n\n init(params: Transform2DParams = {}) {\n const props = ['position', 'size', 'origin', 'anchor', 'scale', 'skew'];\n for (const key of props) {\n Object.assign(this[key], params[key]);\n }\n this.rotation = params.rotation ?? this.rotation;\n }\n\n @Field({\n type: 'vector2',\n step: 1,\n group: 'Transform2D',\n label: 'Position',\n description: 'Position on the design canvas (x right, y down).',\n })\n position: Vector2 = {x: 0, y: 0};\n\n @Field({\n type: 'size',\n step: 1,\n min: 0,\n group: 'Transform2D',\n label: 'Size',\n description: 'Width and height of the object in design pixels.',\n })\n size: Size2 = {width: 0, height: 0};\n\n @Field({\n type: 'vector2',\n step: 0.1,\n group: 'Transform2D',\n label: 'Origin',\n description: 'Local origin used for layout math.',\n })\n origin: Vector2 = {x: 0, y: 0};\n\n @Field({\n type: 'vector2',\n step: 0.1,\n group: 'Transform2D',\n label: 'Anchor',\n description: 'Anchor point (0–1) used when positioning and scaling.',\n })\n anchor: Vector2 = {x: 0, y: 0};\n\n @Field({\n type: 'vector2',\n step: 0.1,\n group: 'Transform2D',\n label: 'Scale',\n description: 'Scale multipliers on X and Y (1 = original size).',\n })\n scale: Vector2 = {x: 1, y: 1};\n\n @Field({\n type: 'vector2',\n step: 0.1,\n group: 'Transform2D',\n label: 'Skew',\n description: 'Skew amounts on X and Y.',\n })\n skew: Vector2 = {x: 0, y: 0};\n\n @Field({\n type: 'number',\n step: 0.1,\n group: 'Transform2D',\n label: 'Rotation',\n description: 'Rotation in radians.',\n editor: 'number-stepper',\n })\n rotation: number = 0;\n}\n\nexport default Transform2D;\n","import { decorators, ComponentChanged, OBSERVER_TYPE, Scene, LOAD_SCENE_MODE, GameObject } from '@combos-fun/engine';\nimport EventEmitter from 'eventemitter3';\nimport { Application, Container } from '@combos-fun/renderer-adapter';\nimport Render from './System';\nimport ContainerManager from './manager/ContainerManager';\nimport Transform2D from './Transform2D';\n\ntype RenderSortDirty = { sortDirty: boolean };\n\n@decorators.componentObserver({\n GameObject: ['parent'],\n Transform2D: [],\n})\nexport default class PixiHierarchy extends EventEmitter {\n name: string = 'PixiHierarchy';\n waitRemoveIds: number[] = [];\n system: Render;\n containerManager: ContainerManager;\n waitChangeScenes: {\n scene: Scene;\n mode: LOAD_SCENE_MODE;\n application: Application;\n }[] = [];\n constructor({ system, containerManager }) {\n super();\n this.containerManager = containerManager;\n this.init(system);\n }\n init(system: Render) {\n this.system = system;\n this.on('changeScene', ({ scene, mode, application }) => {\n this.waitChangeScenes.push({ scene, mode, application });\n });\n }\n update() {\n for (const id of this.waitRemoveIds) {\n this.containerManager.removeContainer(id);\n }\n this.waitRemoveIds = [];\n\n for (const sceneInfo of this.waitChangeScenes) {\n this.ensureSceneContainer(sceneInfo.scene);\n const container = this.containerManager.getContainer(sceneInfo.scene.id);\n if (container) {\n sceneInfo.application.stage.removeChildren();\n sceneInfo.application.stage.addChild(container);\n }\n }\n this.waitChangeScenes = [];\n }\n ensureSceneContainer(scene: Scene) {\n if (this.containerManager.getContainer(scene.id)) return;\n const container = new Container();\n container.label = scene.name;\n this.containerManager.addContainer({\n name: scene.id,\n container,\n });\n }\n ensureContainer(gameObject: GameObject, transform: Transform2D) {\n if (this.containerManager.getContainer(gameObject.id)) {\n transform.worldTransform = this.containerManager.getContainer(gameObject.id)\n .worldTransform as unknown as Transform2D['worldTransform'];\n return;\n }\n const container = new Container();\n container.label = gameObject.name;\n this.containerManager.addContainer({\n name: gameObject.id,\n container,\n });\n transform.worldTransform = container.worldTransform as unknown as Transform2D['worldTransform'];\n }\n componentChanged(changed: ComponentChanged) {\n if (changed.componentName === 'GameObject') {\n this.reparent(changed.gameObject);\n return;\n }\n if (changed.componentName !== 'Transform2D') return;\n if (changed.type === OBSERVER_TYPE.ADD) {\n this.ensureContainer(changed.gameObject, changed.component as Transform2D);\n this.reparent(changed.gameObject);\n } else if (changed.type === OBSERVER_TYPE.REMOVE) {\n this.waitRemoveIds.push(changed.gameObject.id);\n }\n }\n reparent(gameObject?: GameObject) {\n if (!gameObject) return;\n const container = this.containerManager.getContainer(gameObject.id);\n if (!container) return;\n if (gameObject.parent) {\n const parentContainer = this.containerManager.getContainer(gameObject.parent.id);\n if (parentContainer && container.parent !== parentContainer) {\n parentContainer.addChild(container);\n }\n const render = gameObject.parent.getComponent('Render') as unknown as RenderSortDirty;\n if (render) {\n render.sortDirty = true;\n }\n } else if (container.parent) {\n const transform = gameObject.getComponent(Transform2D);\n if (transform) {\n delete transform.worldTransform;\n }\n container.parent.removeChild(container);\n }\n }\n destroy() {\n this.removeAllListeners();\n this.waitRemoveIds = null;\n this.waitChangeScenes = null;\n this.system = null;\n this.containerManager = null;\n }\n}\n","/**\n * Inspired by PixiJS v6\n */\nexport type CompressedTextureExtensions = {\n s3tc?: WEBGL_compressed_texture_s3tc,\n s3tc_sRGB: WEBGL_compressed_texture_s3tc_srgb,\n etc: WEBGL_compressed_texture_etc,\n etc1: WEBGL_compressed_texture_etc1,\n pvrtc: WEBKIT_WEBGL_compressed_texture_pvrtc,\n atc: WEBGL_compressed_texture_atc,\n astc: WEBGL_compressed_texture_astc\n};\nexport type CompressedTextureExtensionRef = keyof CompressedTextureExtensions;\nlet result = undefined;\nexport interface SuportedCompressedTexture {\n s3tc: boolean,\n etc: boolean,\n etc1: boolean,\n pvrtc: boolean,\n atc: boolean,\n astc: boolean,\n}\nexport function getSuportCompressedTextureFormats(gl: WebGLRenderingContext): SuportedCompressedTexture {\n if (result) return result;\n\n if (!gl) {\n // #if _DEBUG\n console.warn('WebGL not available for compressed textures. Silently failing.');\n // #endif\n\n return {\n s3tc: false,\n etc: false,\n etc1: false,\n pvrtc: false,\n atc: false,\n astc: false,\n };\n }\n\n result = {\n s3tc: !!gl.getExtension('WEBGL_compressed_texture_s3tc'),\n etc: !!gl.getExtension('WEBGL_compressed_texture_etc'),\n etc1: !!gl.getExtension('WEBGL_compressed_texture_etc1'),\n pvrtc: !!gl.getExtension('WEBGL_compressed_texture_pvrtc')\n || !!gl.getExtension('WEBKIT_WEBGL_compressed_texture_pvrtc'),\n atc: !!gl.getExtension('WEBGL_compressed_texture_atc'),\n astc: !!gl.getExtension('WEBGL_compressed_texture_astc')\n };\n\n try {\n console.log('Supported compressed texture formats: ' + Object.keys(result).filter((type) => result[type]).join(', '))\n } catch (e) { }\n return result;\n}","import type { ApplicationOptions } from 'pixi.js';\nimport type { RenderQualityInput, ResolvedRenderQuality } from '@combos-fun/engine';\n\n/** Pixi init options with engine-only quality fields removed. */\nexport function pixiRenderOptions(\n params: Partial<ApplicationOptions> & RenderQualityInput = {},\n quality: ResolvedRenderQuality,\n): Partial<ApplicationOptions> {\n const {\n maxPixelRatio: _maxPixelRatio,\n adaptivePixelRatio: _adaptivePixelRatio,\n pauseWhenHidden: _pauseWhenHidden,\n pixelRatio: _pixelRatio,\n devicePixelRatio: _devicePixelRatio,\n ...rest\n } = params;\n return {\n ...rest,\n resolution: quality.pixelRatio,\n autoDensity: quality.autoDensity,\n antialias: quality.antialias,\n ...(quality.powerPreference === 'default' ? {} : { powerPreference: quality.powerPreference }),\n autoStart: true,\n sharedTicker: true,\n };\n}\n","import { System, decorators, Game, LOAD_SCENE_MODE, PureObserverInfo, AdaptivePixelRatio, resolveRenderQuality, shouldPauseRendering } from '@combos-fun/engine';\nimport type { RenderQualityInput, ResolvedRenderQuality, UpdateParams } from '@combos-fun/engine';\nimport { Application } from '@combos-fun/renderer-adapter';\nimport RendererManager from './manager/RendererManager';\nimport ContainerManager from './manager/ContainerManager';\nimport PixiHierarchy from './PixiHierarchy';\nimport Transform2D from './Transform2D';\nimport { Ticker } from 'pixi.js';\nimport type { ApplicationOptions } from 'pixi.js';\nimport type { WebGLRenderer } from 'pixi.js';\nimport { registerCompressedTexture } from './compressedTexture';\nimport { SuportedCompressedTexture, getSuportCompressedTextureFormats } from './compressedTexture/ability';\nimport { pixiRenderOptions } from './renderOptions';\n\nexport enum RENDERER_TYPE {\n UNKNOWN = 0,\n WEBGL = 1,\n CANVAS = 2,\n}\n\n@decorators.componentObserver({\n GameObject: ['parent'],\n Transform2D: [],\n})\nexport default class Renderer extends System<Partial<ApplicationOptions> & RenderQualityInput> {\n static systemName: string = 'Renderer';\n params: Partial<ApplicationOptions> & RenderQualityInput;\n rendererManager: RendererManager;\n containerManager: ContainerManager;\n application: Application | null = null;\n game: Game;\n hierarchy: PixiHierarchy;\n multiApps: Application[] = [];\n suportedCompressedTextureFormats: SuportedCompressedTexture;\n private quality: ResolvedRenderQuality | null = null;\n private adaptive: AdaptivePixelRatio | null = null;\n private viewWidth = 0;\n private viewHeight = 0;\n\n async init(params?: Partial<ApplicationOptions> & RenderQualityInput) {\n this.params = params ?? {};\n this.quality = resolveRenderQuality(this.params, { adaptivePixelRatio: false });\n this.adaptive = new AdaptivePixelRatio({\n pixelRatio: this.quality.pixelRatio,\n ceiling: this.quality.pixelRatioCeiling,\n enabled: this.quality.adaptivePixelRatio,\n });\n const app = await this.createApplication(this.params);\n this.rememberView(app);\n this.application = app;\n this.game.canvas = app.canvas;\n this.containerManager = new ContainerManager();\n this.rendererManager = new RendererManager({\n game: this.game,\n rendererSystem: this,\n });\n\n this.hierarchy = new PixiHierarchy({\n system: this,\n containerManager: this.containerManager,\n });\n this.game.on('sceneChanged', async ({ scene, mode, params: sceneParams }) => {\n let application: Application | null = this.application;\n if (mode === LOAD_SCENE_MODE.MULTI_CANVAS) {\n application = await this.createApplication(sceneParams);\n this.multiApps.push(application);\n }\n if (!application) {\n return;\n }\n scene.canvas = application.canvas;\n this.hierarchy.ensureSceneContainer(scene);\n this.hierarchy.emit('changeScene', {\n scene,\n mode,\n application,\n });\n });\n\n const gl = (app.renderer as WebGLRenderer).gl;\n if (gl) {\n this.suportedCompressedTextureFormats = getSuportCompressedTextureFormats(gl);\n registerCompressedTexture(gl);\n }\n }\n\n registerObserver(observerInfo: PureObserverInfo): void {\n const Ctor = this.constructor as typeof Renderer & { observerInfo: PureObserverInfo };\n if (!Ctor.observerInfo) {\n Ctor.observerInfo = {} as PureObserverInfo;\n }\n const thisObserverInfo = Ctor.observerInfo;\n for (const key in observerInfo) {\n if (!thisObserverInfo[key]) {\n thisObserverInfo[key] = [];\n }\n thisObserverInfo[key].push(...observerInfo[key]);\n }\n }\n\n private async createApplication(params: Partial<ApplicationOptions> & RenderQualityInput = {}): Promise<Application> {\n const quality = resolveRenderQuality(params, { adaptivePixelRatio: false });\n const callerPreference = params.preference;\n const initOptions = pixiRenderOptions(params, quality);\n initOptions.preference = callerPreference ?? ['webgpu', 'webgl'];\n\n const app = new Application();\n try {\n await app.init(initOptions);\n } catch {\n if (callerPreference == null) {\n try {\n await app.init({ ...initOptions, preference: 'webgl' });\n } catch {\n await app.init({ ...initOptions, preference: 'canvas' });\n }\n } else {\n await app.init({ ...initOptions, preference: 'canvas' });\n }\n }\n\n Ticker.shared.stop();\n Ticker.shared.autoStart = false;\n\n return app;\n }\n\n update() {\n const changes = this.componentObserver.clear();\n for (const changed of changes) {\n if (changed.componentName === 'GameObject' && changed.gameObject) {\n this.ensureTransform2D(changed.gameObject);\n if (changed.gameObject.parent) this.ensureTransform2D(changed.gameObject.parent);\n }\n this.hierarchy.componentChanged(changed);\n }\n if (!this.application) {\n return;\n }\n for (const gameObject of this.game.gameObjects) {\n const transform = gameObject.getComponent(Transform2D);\n if (transform) {\n this.containerManager.updateTransform({\n name: gameObject.id,\n transform,\n parentSize: gameObject.parent?.getComponent(Transform2D)?.size,\n });\n }\n this.rendererManager.update(gameObject);\n }\n }\n\n private ensureTransform2D(gameObject: Game['gameObjects'][number]) {\n if (!gameObject || gameObject.destroyed || gameObject === gameObject.scene) return;\n let transform = gameObject.getComponent(Transform2D);\n if (!transform) {\n transform = gameObject.addComponent(new Transform2D());\n }\n if (!transform) return;\n this.hierarchy.ensureContainer(gameObject, transform);\n this.hierarchy.reparent(gameObject);\n }\n\n lateUpdate(e: UpdateParams) {\n if (!this.application) {\n return;\n }\n this.hierarchy.update();\n if (shouldPauseRendering(this.quality?.pauseWhenHidden !== false)) return;\n const next = this.adaptive?.sample(e?.deltaTime ?? 0);\n if (next != null) this.applyPixelRatio(next);\n this.application.ticker.update(e.time);\n }\n\n private rememberView(app: Application) {\n const width = this.params?.width || app.renderer?.screen?.width || 0;\n const height = this.params?.height || app.renderer?.screen?.height || 0;\n if (width) this.viewWidth = width;\n if (height) this.viewHeight = height;\n }\n\n private applyPixelRatio(ratio: number) {\n const renderer = this.application?.renderer;\n if (!renderer || !(ratio > 0)) return;\n renderer.resolution = ratio;\n if (this.viewWidth > 0 && this.viewHeight > 0) {\n renderer.resize(this.viewWidth, this.viewHeight);\n }\n }\n\n onDestroy() {\n this.application?.destroy();\n for (const app of this.multiApps) {\n app && app.destroy();\n }\n this.hierarchy.destroy();\n this.hierarchy = null;\n this.params = null;\n this.rendererManager = null;\n this.containerManager = null;\n this.application = null;\n this.game = null;\n this.multiApps = null;\n }\n\n resize(width, height) {\n if (!this.application) {\n return;\n }\n this.params = { ...this.params, width, height };\n this.viewWidth = width;\n this.viewHeight = height;\n this.application.renderer.resize(width, height);\n }\n}\n","/** Auto-generated by scripts/build-package.mjs — do not edit. */\n\nimport Renderer from './System';\n\nObject.assign(Renderer, {\n packageName: \"@combos-fun/plugin-renderer\",\n packageVersion: \"0.1.22\",\n});\n","/* eslint-disable @typescript-eslint/no-unused-vars */\n\nimport { GameObject, Game, PureObserverInfo, ComponentChanged, System, UpdateParams } from '@combos-fun/engine';\nimport ContainerManager from './manager/ContainerManager';\nimport RendererManager from './manager/RendererManager';\n\nexport default class Renderer<T extends {} = {}> extends System<T> {\n /**\n * Renderer name\n */\n name: string;\n\n /**\n * currentGame\n */\n game: Game;\n\n /**\n * observer component props info\n */\n static observerInfo: PureObserverInfo;\n\n /**\n * observer component props info\n */\n observerInfo: PureObserverInfo;\n\n /**\n * containerManager\n */\n containerManager: ContainerManager;\n rendererManager: RendererManager;\n\n constructor(params?: T) {\n super(params);\n const Ctor = this.constructor as typeof Renderer & { observerInfo: PureObserverInfo };\n this.observerInfo = Ctor.observerInfo;\n }\n\n // init(arg?: any): void;\n\n /**\n * Called when an observed component property changes.\n */\n componentChanged(_changed: ComponentChanged) { }\n\n /**\n * Called every frame.\n * @param _gameObject gameObject\n */\n rendererUpdate(_gameObject: GameObject) { }\n\n override update(e?: UpdateParams): void {\n const changes = this.componentObserver.clear();\n for (const changed of changes) {\n this.componentChanged(changed);\n }\n }\n\n protected asyncIdMap: Record<number, number> = {}\n\n protected increaseAsyncId(id: number) {\n this.asyncIdMap[id] = (this.asyncIdMap[id] || 0) + 1;\n return this.asyncIdMap[id];\n }\n\n protected validateAsyncId(id: number, asyncId: number) {\n return this.asyncIdMap[id] === asyncId;\n }\n}\n","import { compressedTextureUrl, imageFallbackUrl, RESOURCE_TYPE, resource } from '@combos-fun/engine';\nimport type { ResourceStruct } from '@combos-fun/engine';\nimport { CompressedSource, Texture, getSupportedTextureFormats, loadKTX2onWorker } from 'pixi.js';\nimport type { TEXTURE_FORMATS } from 'pixi.js';\n\n/** Compressed targets only. RGBA is omitted so Basis is never expanded to uncompressed pixels. */\nconst COMPRESSED_TARGETS = [\n 'astc-4x4-unorm',\n 'bc7-rgba-unorm',\n 'bc3-rgba-unorm',\n 'etc2-rgba8unorm',\n] as const satisfies readonly TEXTURE_FORMATS[];\n\nfunction asArrayBuffer(data: unknown): ArrayBuffer | null {\n if (data instanceof ArrayBuffer) return data;\n if (ArrayBuffer.isView(data)) {\n const view = data as ArrayBufferView;\n return view.buffer.slice(view.byteOffset, view.byteOffset + view.byteLength) as ArrayBuffer;\n }\n return null;\n}\n\nfunction loadHtmlImage(url: string): Promise<HTMLImageElement> {\n return new Promise((resolve, reject) => {\n const image = new Image();\n image.crossOrigin = 'anonymous';\n image.onload = () => resolve(image);\n image.onerror = () => reject(new Error(`Failed to load image ${url}`));\n image.src = url;\n });\n}\n\nasync function textureFromElement(image: HTMLImageElement): Promise<Texture> {\n if (typeof createImageBitmap !== 'function') return Texture.from(image);\n let bitmap: ImageBitmap | null = null;\n try {\n bitmap = await createImageBitmap(image);\n return Texture.from(bitmap);\n } catch {\n try {\n bitmap?.close();\n } catch {\n // ImageBitmap.close throws once the bitmap is already detached.\n }\n return Texture.from(image);\n }\n}\n\nasync function loadPixiKtx2(url: string): Promise<Texture | null> {\n try {\n const supported = await getSupportedTextureFormats();\n const compressed = COMPRESSED_TARGETS.filter((format) => supported.includes(format));\n if (!compressed.length) return null;\n const options = await loadKTX2onWorker(url, compressed);\n if (!options?.resource || !COMPRESSED_TARGETS.includes(options.format as typeof COMPRESSED_TARGETS[number])) {\n return null;\n }\n return new Texture({ source: new CompressedSource(options) });\n } catch {\n return null;\n }\n}\n\nasync function loadCompressed(res: ResourceStruct, imageData: unknown): Promise<Texture | null> {\n const buffer = asArrayBuffer(imageData);\n if (!buffer) return null;\n const url = compressedTextureUrl(res.src?.image);\n const blobUrl = URL.createObjectURL(new Blob([buffer]));\n try {\n const texture = await loadPixiKtx2(blobUrl);\n if (texture) return texture;\n } finally {\n URL.revokeObjectURL(blobUrl);\n }\n if (!url) return null;\n return loadPixiKtx2(url);\n}\n\n/** Build the shared 2D texture. KTX2 bytes are transcoded; a raster element is uploaded as-is. */\nexport async function createImageTexture(res: ResourceStruct): Promise<Texture | undefined> {\n const imageData = res.data?.image;\n const compressed = await loadCompressed(res, imageData);\n if (compressed) return compressed;\n if (typeof HTMLImageElement !== 'undefined' && imageData instanceof HTMLImageElement) {\n return textureFromElement(imageData);\n }\n const fallback = imageFallbackUrl(res.src?.image);\n if (!fallback) return undefined;\n try {\n return textureFromElement(await loadHtmlImage(fallback));\n } catch {\n return undefined;\n }\n}\n\n/** Texture already built for this resource. Falls back to a raster element when no instance exists. */\nexport function imageResourceTexture(res: ResourceStruct | null | undefined): Texture | undefined {\n if (res?.instance instanceof Texture) return res.instance;\n const image = res?.data?.image;\n if (typeof HTMLImageElement !== 'undefined' && image instanceof HTMLImageElement) {\n return Texture.from(image);\n }\n return undefined;\n}\n\nexport function releaseImageTexture(texture: Texture) {\n const source = texture.source?.resource;\n texture.destroy(true);\n if (typeof ImageBitmap !== 'undefined' && source instanceof ImageBitmap) {\n try {\n source.close();\n } catch {\n // Already closed by the texture source.\n }\n }\n}\n\nresource.registerInstance(RESOURCE_TYPE.IMAGE, async (res) => createImageTexture(res));\nresource.registerDestroy(RESOURCE_TYPE.IMAGE, ({ instance }) => {\n if (!instance || instance === Texture.EMPTY) return;\n releaseImageTexture(instance as Texture);\n});\n","import RendererSystem, { RENDERER_TYPE } from './System';\nimport RendererManager from './manager/RendererManager';\nimport ContainerManager from './manager/ContainerManager';\nimport Renderer from './Renderer';\nimport Transform2D from './Transform2D';\nimport { createImageTexture, imageResourceTexture, releaseImageTexture } from './imageTexture';\n\n/** Shared resource cache key separator used across renderer plugins */\nexport const RESOURCE_KEY_SPLIT = '_s|r|c_';\n\nexport type { Transform2DParams, TransformMatrix } from './Transform2D';\nexport { RendererManager, ContainerManager, RendererSystem, RENDERER_TYPE, Renderer, Transform2D };\nexport { createImageTexture, imageResourceTexture, releaseImageTexture };\n\n"],"names":["Renderer","PixiHierarchy"],"mappings":";;;;;;;;AAKA,MAAM,eAAe,CAAA;AAGnB,IAAA,WAAA,CAAY,EAAE,IAAI,EAAE,cAAc,EAAE,EAAA;QAIpC,IAAA,CAAA,SAAS,GAAe,EAAE;AAHxB,QAAA,IAAI,CAAC,IAAI,GAAG,IAAI;AAChB,QAAA,IAAI,CAAC,cAAc,GAAG,cAAc;IACtC;IAEA,QAAQ,CAAC,GAAG,SAAqB,EAAA;AAC/B,QAAA,KAAK,MAAM,QAAQ,IAAI,SAAS,EAAE;AAChC,YAAA,QAAQ,CAAC,IAAI,GAAG,IAAI,CAAC,IAAI;YACzB,QAAQ,CAAC,eAAe,GAAG,IAAI,CAA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,IAAA,MAAM,KAAK,GAAG,GAAG,EAAE,IAAI,EAAE,KAAK;IAC9B,IAAI,OAAO,gBAAgB,KAAK,WAAW,IAAI,KAAK,YAAY,gBAAgB,EAAE;AAChF,QAAA,OAAO,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC;IAC5B;AACA,IAAA,OAAO,SAAS;AAClB;AAEM,SAAU,mBAAmB,CAAC,OAAgB,EAAA;AAClD,IAAA,MAAM,MAAM,GAAG,OAAO,CAAC,MAAM,EAAE,QAAQ;AACvC,IAAA,OAAO,CAAC,OAAO,CAAC,IAAI,CAAC;IACrB,IAAI,OAAO,WAAW,KAAK,WAAW,IAAI,MAAM,YAAY,WAAW,EAAE;AACvE,QAAA,IAAI;YACF,MAAM,CAAC,KAAK,EAAE;QAChB;AAAE,QAAA,MAAM;;QAER;IACF;AACF;AAEA,QAAQ,CAAC,gBAAgB,CAAC,aAAa,CAAC,KAAK,EAAE,OAAO,GAAG,KAAK,kBAAkB,CAAC,GAAG,CAAC,CAAC;AACtF,QAAQ,CAAC,eAAe,CAAC,aAAa,CAAC,KAAK,EAAE,CAAC,EAAE,QAAQ,EAAE,KAAI;AAC7D,IAAA,IAAI,CAAC,QAAQ,IAAI,QAAQ,KAAK,OAAO,CAAC,KAAK;QAAE;IAC7C,mBAAmB,CAAC,QAAmB,CAAC;AAC1C,CAAC,CAAC;;AClHF;AACO,MAAM,kBAAkB,GAAG;;;;"}
1
+ {"version":3,"file":"plugin-renderer.esm.js","sources":["../lib/manager/RendererManager.ts","../lib/manager/ContainerManager.ts","../lib/Transform2D.ts","../lib/PixiHierarchy.ts","../lib/compressedTexture/ability.ts","../lib/renderOptions.ts","../lib/System.ts","../lib/__combosPackageMeta.gen.ts","../lib/Renderer.ts","../lib/imageTexture.ts","../lib/index.ts"],"sourcesContent":["import isEqual from 'lodash-es/isEqual';\nimport { GameObject, Game, ComponentChanged, OBSERVER_TYPE } from '@combos-fun/engine';\nimport Renderer from '../Renderer';\nimport RendererSystem from '../System';\n\nclass RendererManager {\n game: Game;\n rendererSystem: RendererSystem;\n constructor({ game, rendererSystem }) {\n this.game = game;\n this.rendererSystem = rendererSystem;\n }\n renderers: Renderer[] = [];\n register(...renderers: Renderer[]) {\n for (const renderer of renderers) {\n renderer.game = this.game;\n renderer.rendererManager = this.rendererSystem.rendererManager;\n renderer.containerManager = this.rendererSystem.containerManager;\n this.renderers.push(renderer);\n }\n }\n componentChanged(changes: ComponentChanged[]) {\n for (const changed of changes) {\n for (const renderer of this.renderers) {\n const props = renderer.observerInfo[changed.componentName];\n if (props) {\n if ([OBSERVER_TYPE.ADD, OBSERVER_TYPE.REMOVE].indexOf(changed.type) > -1) {\n try {\n renderer.componentChanged && renderer.componentChanged(changed);\n } catch (e) {\n console.error(`gameObject: ${changed.gameObject.name}, ${changed.componentName} is error.`, changed, e);\n }\n continue;\n }\n\n const index = props.findIndex(prop => {\n return isEqual(prop, changed.prop);\n });\n\n if (index > -1) {\n try {\n renderer.componentChanged && renderer.componentChanged(changed);\n } catch (e) {\n console.error(\n `gameObject: ${changed.gameObject && changed.gameObject.name}, ${\n changed.componentName\n } is componentChanged error.`,\n changed,\n e,\n );\n }\n }\n }\n }\n }\n }\n update(gameObject: GameObject) {\n for (const component of gameObject.components) {\n for (const renderer of this.renderers) {\n const cache = [];\n const props = renderer.observerInfo[component.name];\n if (props && cache.indexOf(gameObject) === -1) {\n cache.push(gameObject);\n try {\n renderer.rendererUpdate && renderer.rendererUpdate(gameObject);\n } catch (e) {\n console.info(`gameObject: ${gameObject.name}, ${component.name} is update error`, e);\n }\n }\n }\n }\n }\n}\nexport default RendererManager;\n","import { Point, ObservablePoint } from 'pixi.js';\nimport { Container } from '@combos-fun/renderer-adapter';\nimport type Transform2D from '../Transform2D';\n\nexport default class ContainerManager {\n containerMap: { [propName: number]: Container } = {};\n addContainer({ name, container }: { name: number; container: Container }) {\n this.containerMap[name] = container;\n }\n getContainer(name: number) {\n return this.containerMap[name];\n }\n removeContainer(name: number) {\n this.containerMap[name]?.destroy({ children: true });\n delete this.containerMap[name];\n }\n updateTransform({\n name,\n transform,\n parentSize,\n }: {\n name: number;\n transform: Transform2D;\n parentSize?: { width: number; height: number };\n }) {\n const container = this.containerMap[name];\n if (!container || !transform) return;\n const { anchor, origin, position, rotation, scale, size, skew } = transform;\n container.rotation = rotation;\n container.scale = scale as Point;\n container.pivot.x = size.width * origin.x;\n container.pivot.y = size.height * origin.y;\n container.skew = skew as ObservablePoint;\n let x = position.x;\n let y = position.y;\n if (parentSize) {\n x = x + parentSize.width * anchor.x;\n y = y + parentSize.height * anchor.y;\n }\n\n container.position = { x, y } as Point;\n }\n}\n","import { Component } from '@combos-fun/engine';\nimport type { ComponentParams } from '@combos-fun/engine';\nimport { Field } from '@combos-fun/inspector-decorator';\n\ninterface Vector2 {\n x: number;\n y: number;\n}\n\ninterface Size2 {\n width: number;\n height: number;\n}\n\nexport interface TransformMatrix {\n a: number;\n b: number;\n c: number;\n d: number;\n tx: number;\n ty: number;\n array?: number[];\n}\n\nexport interface Transform2DParams extends ComponentParams {\n position?: Vector2;\n size?: Size2;\n origin?: Vector2;\n anchor?: Vector2;\n scale?: Vector2;\n skew?: Vector2;\n rotation?: number;\n}\n\n/** 2D layout pose. Hierarchy lives on GameObject. */\nclass Transform2D extends Component<Transform2DParams> {\n static componentName: string = 'Transform2D';\n readonly name: string = 'Transform2D';\n\n worldTransform: TransformMatrix;\n\n init(params: Transform2DParams = {}) {\n const props = ['position', 'size', 'origin', 'anchor', 'scale', 'skew'];\n for (const key of props) {\n Object.assign(this[key], params[key]);\n }\n this.rotation = params.rotation ?? this.rotation;\n }\n\n @Field({\n type: 'vector2',\n step: 1,\n group: 'Transform2D',\n label: 'Position',\n description: 'Position on the design canvas (x right, y down).',\n })\n position: Vector2 = {x: 0, y: 0};\n\n @Field({\n type: 'size',\n step: 1,\n min: 0,\n group: 'Transform2D',\n label: 'Size',\n description: 'Width and height of the object in design pixels.',\n })\n size: Size2 = {width: 0, height: 0};\n\n @Field({\n type: 'vector2',\n step: 0.1,\n group: 'Transform2D',\n label: 'Origin',\n description: 'Local origin used for layout math.',\n })\n origin: Vector2 = {x: 0, y: 0};\n\n @Field({\n type: 'vector2',\n step: 0.1,\n group: 'Transform2D',\n label: 'Anchor',\n description: 'Anchor point (0–1) used when positioning and scaling.',\n })\n anchor: Vector2 = {x: 0, y: 0};\n\n @Field({\n type: 'vector2',\n step: 0.1,\n group: 'Transform2D',\n label: 'Scale',\n description: 'Scale multipliers on X and Y (1 = original size).',\n })\n scale: Vector2 = {x: 1, y: 1};\n\n @Field({\n type: 'vector2',\n step: 0.1,\n group: 'Transform2D',\n label: 'Skew',\n description: 'Skew amounts on X and Y.',\n })\n skew: Vector2 = {x: 0, y: 0};\n\n @Field({\n type: 'number',\n step: 0.1,\n group: 'Transform2D',\n label: 'Rotation',\n description: 'Rotation in radians.',\n editor: 'number-stepper',\n })\n rotation: number = 0;\n}\n\nexport default Transform2D;\n","import { decorators, ComponentChanged, OBSERVER_TYPE, Scene, LOAD_SCENE_MODE, GameObject } from '@combos-fun/engine';\nimport EventEmitter from 'eventemitter3';\nimport { Application, Container } from '@combos-fun/renderer-adapter';\nimport Render from './System';\nimport ContainerManager from './manager/ContainerManager';\nimport Transform2D from './Transform2D';\n\ntype RenderSortDirty = { sortDirty: boolean };\n\n@decorators.componentObserver({\n GameObject: ['parent'],\n Transform2D: [],\n})\nexport default class PixiHierarchy extends EventEmitter {\n name: string = 'PixiHierarchy';\n waitRemoveIds: number[] = [];\n system: Render;\n containerManager: ContainerManager;\n waitChangeScenes: {\n scene: Scene;\n mode: LOAD_SCENE_MODE;\n application: Application;\n }[] = [];\n constructor({ system, containerManager }) {\n super();\n this.containerManager = containerManager;\n this.init(system);\n }\n init(system: Render) {\n this.system = system;\n this.on('changeScene', ({ scene, mode, application }) => {\n this.waitChangeScenes.push({ scene, mode, application });\n });\n }\n update() {\n for (const id of this.waitRemoveIds) {\n this.containerManager.removeContainer(id);\n }\n this.waitRemoveIds = [];\n\n for (const sceneInfo of this.waitChangeScenes) {\n this.ensureSceneContainer(sceneInfo.scene);\n const container = this.containerManager.getContainer(sceneInfo.scene.id);\n if (container) {\n sceneInfo.application.stage.removeChildren();\n sceneInfo.application.stage.addChild(container);\n }\n }\n this.waitChangeScenes = [];\n }\n ensureSceneContainer(scene: Scene) {\n if (this.containerManager.getContainer(scene.id)) return;\n const container = new Container();\n container.label = scene.name;\n this.containerManager.addContainer({\n name: scene.id,\n container,\n });\n }\n ensureContainer(gameObject: GameObject, transform: Transform2D) {\n if (this.containerManager.getContainer(gameObject.id)) {\n transform.worldTransform = this.containerManager.getContainer(gameObject.id)\n .worldTransform as unknown as Transform2D['worldTransform'];\n return;\n }\n const container = new Container();\n container.label = gameObject.name;\n this.containerManager.addContainer({\n name: gameObject.id,\n container,\n });\n transform.worldTransform = container.worldTransform as unknown as Transform2D['worldTransform'];\n }\n componentChanged(changed: ComponentChanged) {\n if (changed.componentName === 'GameObject') {\n this.reparent(changed.gameObject);\n return;\n }\n if (changed.componentName !== 'Transform2D') return;\n if (changed.type === OBSERVER_TYPE.ADD) {\n this.ensureContainer(changed.gameObject, changed.component as Transform2D);\n this.reparent(changed.gameObject);\n } else if (changed.type === OBSERVER_TYPE.REMOVE) {\n this.waitRemoveIds.push(changed.gameObject.id);\n }\n }\n reparent(gameObject?: GameObject) {\n if (!gameObject) return;\n const container = this.containerManager.getContainer(gameObject.id);\n if (!container) return;\n if (gameObject.parent) {\n const parentContainer = this.containerManager.getContainer(gameObject.parent.id);\n if (parentContainer && container.parent !== parentContainer) {\n parentContainer.addChild(container);\n }\n const render = gameObject.parent.getComponent('Render') as unknown as RenderSortDirty;\n if (render) {\n render.sortDirty = true;\n }\n } else if (container.parent) {\n const transform = gameObject.getComponent(Transform2D);\n if (transform) {\n delete transform.worldTransform;\n }\n container.parent.removeChild(container);\n }\n }\n destroy() {\n this.removeAllListeners();\n this.waitRemoveIds = null;\n this.waitChangeScenes = null;\n this.system = null;\n this.containerManager = null;\n }\n}\n","/**\n * Inspired by PixiJS v6\n */\nexport type CompressedTextureExtensions = {\n s3tc?: WEBGL_compressed_texture_s3tc,\n s3tc_sRGB: WEBGL_compressed_texture_s3tc_srgb,\n etc: WEBGL_compressed_texture_etc,\n etc1: WEBGL_compressed_texture_etc1,\n pvrtc: WEBKIT_WEBGL_compressed_texture_pvrtc,\n atc: WEBGL_compressed_texture_atc,\n astc: WEBGL_compressed_texture_astc\n};\nexport type CompressedTextureExtensionRef = keyof CompressedTextureExtensions;\nlet result = undefined;\nexport interface SuportedCompressedTexture {\n s3tc: boolean,\n etc: boolean,\n etc1: boolean,\n pvrtc: boolean,\n atc: boolean,\n astc: boolean,\n}\nexport function getSuportCompressedTextureFormats(gl: WebGLRenderingContext): SuportedCompressedTexture {\n if (result) return result;\n\n if (!gl) {\n // #if _DEBUG\n console.warn('WebGL not available for compressed textures. Silently failing.');\n // #endif\n\n return {\n s3tc: false,\n etc: false,\n etc1: false,\n pvrtc: false,\n atc: false,\n astc: false,\n };\n }\n\n result = {\n s3tc: !!gl.getExtension('WEBGL_compressed_texture_s3tc'),\n etc: !!gl.getExtension('WEBGL_compressed_texture_etc'),\n etc1: !!gl.getExtension('WEBGL_compressed_texture_etc1'),\n pvrtc: !!gl.getExtension('WEBGL_compressed_texture_pvrtc')\n || !!gl.getExtension('WEBKIT_WEBGL_compressed_texture_pvrtc'),\n atc: !!gl.getExtension('WEBGL_compressed_texture_atc'),\n astc: !!gl.getExtension('WEBGL_compressed_texture_astc')\n };\n\n try {\n console.log('Supported compressed texture formats: ' + Object.keys(result).filter((type) => result[type]).join(', '))\n } catch (e) { }\n return result;\n}","import type { ApplicationOptions } from 'pixi.js';\nimport type { RenderQualityInput, ResolvedRenderQuality } from '@combos-fun/engine';\n\n/** Pixi init options with engine-only quality fields removed. */\nexport function pixiRenderOptions(\n params: Partial<ApplicationOptions> & RenderQualityInput = {},\n quality: ResolvedRenderQuality,\n): Partial<ApplicationOptions> {\n const {\n maxPixelRatio: _maxPixelRatio,\n adaptivePixelRatio: _adaptivePixelRatio,\n pauseWhenHidden: _pauseWhenHidden,\n pixelRatio: _pixelRatio,\n devicePixelRatio: _devicePixelRatio,\n ...rest\n } = params;\n return {\n ...rest,\n resolution: quality.pixelRatio,\n autoDensity: quality.autoDensity,\n antialias: quality.antialias,\n ...(quality.powerPreference === 'default' ? {} : { powerPreference: quality.powerPreference }),\n autoStart: true,\n sharedTicker: true,\n };\n}\n","import { System, decorators, Game, LOAD_SCENE_MODE, PureObserverInfo, AdaptivePixelRatio, resolveRenderQuality, shouldPauseRendering, fitOrthographicDisplay } from '@combos-fun/engine';\nimport type { OrthographicDisplayFrame, RenderQualityInput, ResolvedRenderQuality, UpdateParams } from '@combos-fun/engine';\nimport { Application } from '@combos-fun/renderer-adapter';\nimport RendererManager from './manager/RendererManager';\nimport ContainerManager from './manager/ContainerManager';\nimport PixiHierarchy from './PixiHierarchy';\nimport Transform2D from './Transform2D';\nimport { Ticker } from 'pixi.js';\nimport type { ApplicationOptions } from 'pixi.js';\nimport type { WebGLRenderer } from 'pixi.js';\nimport { registerCompressedTexture } from './compressedTexture';\nimport { SuportedCompressedTexture, getSuportCompressedTextureFormats } from './compressedTexture/ability';\nimport { pixiRenderOptions } from './renderOptions';\n\nexport enum RENDERER_TYPE {\n UNKNOWN = 0,\n WEBGL = 1,\n CANVAS = 2,\n}\n\n@decorators.componentObserver({\n GameObject: ['parent'],\n Transform2D: [],\n})\nexport default class Renderer extends System<Partial<ApplicationOptions> & RenderQualityInput> {\n static systemName: string = 'Renderer';\n params: Partial<ApplicationOptions> & RenderQualityInput;\n rendererManager: RendererManager;\n containerManager: ContainerManager;\n application: Application | null = null;\n game: Game;\n hierarchy: PixiHierarchy;\n multiApps: Application[] = [];\n suportedCompressedTextureFormats: SuportedCompressedTexture;\n private quality: ResolvedRenderQuality | null = null;\n private adaptive: AdaptivePixelRatio | null = null;\n private viewWidth = 0;\n private viewHeight = 0;\n private pixelRatio = 1;\n private resizeObserver: ResizeObserver | null = null;\n private viewListeners = new Set<(frame: OrthographicDisplayFrame) => void>();\n displayFrame: OrthographicDisplayFrame | null = null;\n\n async init(params?: Partial<ApplicationOptions> & RenderQualityInput) {\n this.params = params ?? {};\n this.quality = resolveRenderQuality(this.params, { adaptivePixelRatio: false });\n this.pixelRatio = this.quality.pixelRatio;\n this.adaptive = new AdaptivePixelRatio({\n pixelRatio: this.quality.pixelRatio,\n ceiling: this.quality.pixelRatioCeiling,\n enabled: this.quality.adaptivePixelRatio,\n });\n const app = await this.createApplication(this.params);\n this.rememberView(app);\n this.application = app;\n this.game.canvas = app.canvas;\n this.observeCanvas(app.canvas);\n this.containerManager = new ContainerManager();\n this.rendererManager = new RendererManager({\n game: this.game,\n rendererSystem: this,\n });\n\n this.hierarchy = new PixiHierarchy({\n system: this,\n containerManager: this.containerManager,\n });\n this.game.on('sceneChanged', async ({ scene, mode, params: sceneParams }) => {\n let application: Application | null = this.application;\n if (mode === LOAD_SCENE_MODE.MULTI_CANVAS) {\n application = await this.createApplication(sceneParams);\n this.multiApps.push(application);\n }\n if (!application) {\n return;\n }\n scene.canvas = application.canvas;\n this.hierarchy.ensureSceneContainer(scene);\n this.hierarchy.emit('changeScene', {\n scene,\n mode,\n application,\n });\n });\n\n const gl = (app.renderer as WebGLRenderer).gl;\n if (gl) {\n this.suportedCompressedTextureFormats = getSuportCompressedTextureFormats(gl);\n registerCompressedTexture(gl);\n }\n }\n\n registerObserver(observerInfo: PureObserverInfo): void {\n const Ctor = this.constructor as typeof Renderer & { observerInfo: PureObserverInfo };\n if (!Ctor.observerInfo) {\n Ctor.observerInfo = {} as PureObserverInfo;\n }\n const thisObserverInfo = Ctor.observerInfo;\n for (const key in observerInfo) {\n if (!thisObserverInfo[key]) {\n thisObserverInfo[key] = [];\n }\n thisObserverInfo[key].push(...observerInfo[key]);\n }\n }\n\n private async createApplication(params: Partial<ApplicationOptions> & RenderQualityInput = {}): Promise<Application> {\n const quality = resolveRenderQuality(params, { adaptivePixelRatio: false });\n const callerPreference = params.preference;\n const initOptions = pixiRenderOptions(params, quality);\n initOptions.preference = callerPreference ?? ['webgpu', 'webgl'];\n\n const app = new Application();\n try {\n await app.init(initOptions);\n } catch {\n if (callerPreference == null) {\n try {\n await app.init({ ...initOptions, preference: 'webgl' });\n } catch {\n await app.init({ ...initOptions, preference: 'canvas' });\n }\n } else {\n await app.init({ ...initOptions, preference: 'canvas' });\n }\n }\n\n Ticker.shared.stop();\n Ticker.shared.autoStart = false;\n\n return app;\n }\n\n update() {\n const changes = this.componentObserver.clear();\n for (const changed of changes) {\n if (changed.componentName === 'GameObject' && changed.gameObject) {\n this.ensureTransform2D(changed.gameObject);\n if (changed.gameObject.parent) this.ensureTransform2D(changed.gameObject.parent);\n }\n this.hierarchy.componentChanged(changed);\n }\n if (!this.application) {\n return;\n }\n for (const gameObject of this.game.gameObjects) {\n const transform = gameObject.getComponent(Transform2D);\n if (transform) {\n this.containerManager.updateTransform({\n name: gameObject.id,\n transform,\n parentSize: gameObject.parent?.getComponent(Transform2D)?.size,\n });\n }\n this.rendererManager.update(gameObject);\n }\n }\n\n private ensureTransform2D(gameObject: Game['gameObjects'][number]) {\n if (!gameObject || gameObject.destroyed || gameObject === gameObject.scene) return;\n let transform = gameObject.getComponent(Transform2D);\n if (!transform) {\n transform = gameObject.addComponent(new Transform2D());\n }\n if (!transform) return;\n this.hierarchy.ensureContainer(gameObject, transform);\n this.hierarchy.reparent(gameObject);\n }\n\n lateUpdate(e: UpdateParams) {\n if (!this.application) {\n return;\n }\n this.hierarchy.update();\n if (shouldPauseRendering(this.quality?.pauseWhenHidden !== false)) return;\n const next = this.adaptive?.sample(e?.deltaTime ?? 0);\n if (next != null) {\n this.pixelRatio = next;\n this.applyDisplay();\n }\n this.application.ticker.update(e.time);\n }\n\n onDisplayFrame(listener: (frame: OrthographicDisplayFrame) => void): () => void {\n this.viewListeners.add(listener);\n if (this.displayFrame) listener(this.displayFrame);\n return () => {\n this.viewListeners.delete(listener);\n };\n }\n\n private observeCanvas(canvas: HTMLCanvasElement) {\n this.resizeObserver?.disconnect();\n if (typeof ResizeObserver !== 'undefined') {\n this.resizeObserver = new ResizeObserver(() => this.applyDisplay());\n this.resizeObserver.observe(canvas);\n }\n this.applyDisplay();\n }\n\n private applyDisplay() {\n const app = this.application;\n const canvas = app?.canvas;\n if (!app || !canvas || this.viewWidth <= 0 || this.viewHeight <= 0) return;\n if (typeof canvas.getBoundingClientRect !== 'function') return;\n const box = canvas.getBoundingClientRect();\n const frame = fitOrthographicDisplay({\n box: { width: box.width, height: box.height },\n width: this.viewWidth,\n height: this.viewHeight,\n resolution: this.pixelRatio,\n });\n if (!frame) return;\n const current = this.displayFrame;\n if (\n current\n && current.bufferWidth === frame.bufferWidth\n && current.bufferHeight === frame.bufferHeight\n && Math.abs(current.originX - frame.originX) < 1e-4\n && Math.abs(current.visibleWidth - frame.visibleWidth) < 1e-4\n ) {\n return;\n }\n app.renderer.resize(frame.visibleWidth, frame.visibleHeight, frame.pixelRatio);\n app.stage.position.set(-frame.originX, -frame.originY);\n this.displayFrame = frame;\n for (const listener of this.viewListeners) listener(frame);\n }\n\n private rememberView(app: Application) {\n const width = this.params?.width || app.renderer?.screen?.width || 0;\n const height = this.params?.height || app.renderer?.screen?.height || 0;\n if (width) this.viewWidth = width;\n if (height) this.viewHeight = height;\n }\n\n onDestroy() {\n this.resizeObserver?.disconnect();\n this.resizeObserver = null;\n this.viewListeners.clear();\n this.displayFrame = null;\n this.application?.destroy();\n for (const app of this.multiApps) {\n app && app.destroy();\n }\n this.hierarchy.destroy();\n this.hierarchy = null;\n this.params = null;\n this.rendererManager = null;\n this.containerManager = null;\n this.application = null;\n this.game = null;\n this.multiApps = null;\n }\n\n resize(width, height) {\n if (!this.application) {\n return;\n }\n this.params = { ...this.params, width, height };\n this.viewWidth = width;\n this.viewHeight = height;\n this.displayFrame = null;\n this.applyDisplay();\n }\n}\n","/** Auto-generated by scripts/build-package.mjs — do not edit. */\n\nimport Renderer from './System';\n\nObject.assign(Renderer, {\n packageName: \"@combos-fun/plugin-renderer\",\n packageVersion: \"0.1.24\",\n});\n","/* eslint-disable @typescript-eslint/no-unused-vars */\n\nimport { GameObject, Game, PureObserverInfo, ComponentChanged, System, UpdateParams } from '@combos-fun/engine';\nimport ContainerManager from './manager/ContainerManager';\nimport RendererManager from './manager/RendererManager';\n\nexport default class Renderer<T extends {} = {}> extends System<T> {\n /**\n * Renderer name\n */\n name: string;\n\n /**\n * currentGame\n */\n game: Game;\n\n /**\n * observer component props info\n */\n static observerInfo: PureObserverInfo;\n\n /**\n * observer component props info\n */\n observerInfo: PureObserverInfo;\n\n /**\n * containerManager\n */\n containerManager: ContainerManager;\n rendererManager: RendererManager;\n\n constructor(params?: T) {\n super(params);\n const Ctor = this.constructor as typeof Renderer & { observerInfo: PureObserverInfo };\n this.observerInfo = Ctor.observerInfo;\n }\n\n // init(arg?: any): void;\n\n /**\n * Called when an observed component property changes.\n */\n componentChanged(_changed: ComponentChanged) { }\n\n /**\n * Called every frame.\n * @param _gameObject gameObject\n */\n rendererUpdate(_gameObject: GameObject) { }\n\n override update(e?: UpdateParams): void {\n const changes = this.componentObserver.clear();\n for (const changed of changes) {\n this.componentChanged(changed);\n }\n }\n\n protected asyncIdMap: Record<number, number> = {}\n\n protected increaseAsyncId(id: number) {\n this.asyncIdMap[id] = (this.asyncIdMap[id] || 0) + 1;\n return this.asyncIdMap[id];\n }\n\n protected validateAsyncId(id: number, asyncId: number) {\n return this.asyncIdMap[id] === asyncId;\n }\n}\n","import { compressedTextureUrl, imageFallbackUrl, RESOURCE_TYPE, resource } from '@combos-fun/engine';\nimport type { ResourceStruct } from '@combos-fun/engine';\nimport { CompressedSource, Texture, getSupportedTextureFormats, loadKTX2onWorker } from 'pixi.js';\nimport type { TEXTURE_FORMATS } from 'pixi.js';\n\n/** Compressed targets only. RGBA is omitted so Basis is never expanded to uncompressed pixels. */\nconst COMPRESSED_TARGETS = [\n 'astc-4x4-unorm',\n 'bc7-rgba-unorm',\n 'bc3-rgba-unorm',\n 'etc2-rgba8unorm',\n] as const satisfies readonly TEXTURE_FORMATS[];\n\nfunction asArrayBuffer(data: unknown): ArrayBuffer | null {\n if (data instanceof ArrayBuffer) return data;\n if (ArrayBuffer.isView(data)) {\n const view = data as ArrayBufferView;\n return view.buffer.slice(view.byteOffset, view.byteOffset + view.byteLength) as ArrayBuffer;\n }\n return null;\n}\n\nfunction loadHtmlImage(url: string): Promise<HTMLImageElement> {\n return new Promise((resolve, reject) => {\n const image = new Image();\n image.crossOrigin = 'anonymous';\n image.onload = () => resolve(image);\n image.onerror = () => reject(new Error(`Failed to load image ${url}`));\n image.src = url;\n });\n}\n\nasync function textureFromElement(image: HTMLImageElement): Promise<Texture> {\n if (typeof createImageBitmap !== 'function') return Texture.from(image);\n let bitmap: ImageBitmap | null = null;\n try {\n bitmap = await createImageBitmap(image);\n return Texture.from(bitmap);\n } catch {\n try {\n bitmap?.close();\n } catch {\n // ImageBitmap.close throws once the bitmap is already detached.\n }\n return Texture.from(image);\n }\n}\n\nasync function loadPixiKtx2(url: string): Promise<Texture | null> {\n try {\n const supported = await getSupportedTextureFormats();\n const compressed = COMPRESSED_TARGETS.filter((format) => supported.includes(format));\n if (!compressed.length) return null;\n const options = await loadKTX2onWorker(url, compressed);\n if (!options?.resource || !COMPRESSED_TARGETS.includes(options.format as typeof COMPRESSED_TARGETS[number])) {\n return null;\n }\n return new Texture({ source: new CompressedSource(options) });\n } catch {\n return null;\n }\n}\n\nasync function loadCompressed(res: ResourceStruct, imageData: unknown): Promise<Texture | null> {\n const buffer = asArrayBuffer(imageData);\n if (!buffer) return null;\n const url = compressedTextureUrl(res.src?.image);\n const blobUrl = URL.createObjectURL(new Blob([buffer]));\n try {\n const texture = await loadPixiKtx2(blobUrl);\n if (texture) return texture;\n } finally {\n URL.revokeObjectURL(blobUrl);\n }\n if (!url) return null;\n return loadPixiKtx2(url);\n}\n\n/** Build the shared 2D texture. KTX2 bytes are transcoded; a raster element is uploaded as-is. */\nexport async function createImageTexture(res: ResourceStruct): Promise<Texture | undefined> {\n const imageData = res.data?.image;\n const compressed = await loadCompressed(res, imageData);\n if (compressed) return compressed;\n if (typeof HTMLImageElement !== 'undefined' && imageData instanceof HTMLImageElement) {\n return textureFromElement(imageData);\n }\n const fallback = imageFallbackUrl(res.src?.image);\n if (!fallback) return undefined;\n try {\n return textureFromElement(await loadHtmlImage(fallback));\n } catch {\n return undefined;\n }\n}\n\n/** Texture already built for this resource. Falls back to a raster element when no instance exists. */\nexport function imageResourceTexture(res: ResourceStruct | null | undefined): Texture | undefined {\n if (res?.instance instanceof Texture) return res.instance;\n const image = res?.data?.image;\n if (typeof HTMLImageElement !== 'undefined' && image instanceof HTMLImageElement) {\n return Texture.from(image);\n }\n return undefined;\n}\n\nexport function releaseImageTexture(texture: Texture) {\n const source = texture.source?.resource;\n texture.destroy(true);\n if (typeof ImageBitmap !== 'undefined' && source instanceof ImageBitmap) {\n try {\n source.close();\n } catch {\n // Already closed by the texture source.\n }\n }\n}\n\nresource.registerInstance(RESOURCE_TYPE.IMAGE, async (res) => createImageTexture(res));\nresource.registerDestroy(RESOURCE_TYPE.IMAGE, ({ instance }) => {\n if (!instance || instance === Texture.EMPTY) return;\n releaseImageTexture(instance as Texture);\n});\n","import RendererSystem, { RENDERER_TYPE } from './System';\nimport RendererManager from './manager/RendererManager';\nimport ContainerManager from './manager/ContainerManager';\nimport Renderer from './Renderer';\nimport Transform2D from './Transform2D';\nimport { createImageTexture, imageResourceTexture, releaseImageTexture } from './imageTexture';\n\n/** Shared resource cache key separator used across renderer plugins */\nexport const RESOURCE_KEY_SPLIT = '_s|r|c_';\n\nexport type { Transform2DParams, TransformMatrix } from './Transform2D';\nexport { RendererManager, ContainerManager, RendererSystem, RENDERER_TYPE, Renderer, Transform2D };\nexport { createImageTexture, imageResourceTexture, releaseImageTexture };\n\n"],"names":["Renderer","PixiHierarchy"],"mappings":";;;;;;;;AAKA,MAAM,eAAe,CAAA;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AAY,OAAO;QAAE,OAAO,GAAG,CAAC,QAAQ;AACzD,IAAA,MAAM,KAAK,GAAG,GAAG,EAAE,IAAI,EAAE,KAAK;IAC9B,IAAI,OAAO,gBAAgB,KAAK,WAAW,IAAI,KAAK,YAAY,gBAAgB,EAAE;AAChF,QAAA,OAAO,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC;IAC5B;AACA,IAAA,OAAO,SAAS;AAClB;AAEM,SAAU,mBAAmB,CAAC,OAAgB,EAAA;AAClD,IAAA,MAAM,MAAM,GAAG,OAAO,CAAC,MAAM,EAAE,QAAQ;AACvC,IAAA,OAAO,CAAC,OAAO,CAAC,IAAI,CAAC;IACrB,IAAI,OAAO,WAAW,KAAK,WAAW,IAAI,MAAM,YAAY,WAAW,EAAE;AACvE,QAAA,IAAI;YACF,MAAM,CAAC,KAAK,EAAE;QAChB;AAAE,QAAA,MAAM;;QAER;IACF;AACF;AAEA,QAAQ,CAAC,gBAAgB,CAAC,aAAa,CAAC,KAAK,EAAE,OAAO,GAAG,KAAK,kBAAkB,CAAC,GAAG,CAAC,CAAC;AACtF,QAAQ,CAAC,eAAe,CAAC,aAAa,CAAC,KAAK,EAAE,CAAC,EAAE,QAAQ,EAAE,KAAI;AAC7D,IAAA,IAAI,CAAC,QAAQ,IAAI,QAAQ,KAAK,OAAO,CAAC,KAAK;QAAE;IAC7C,mBAAmB,CAAC,QAAmB,CAAC;AAC1C,CAAC,CAAC;;AClHF;AACO,MAAM,kBAAkB,GAAG;;;;"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@combos-fun/plugin-renderer",
3
- "version": "0.1.22",
3
+ "version": "0.1.24",
4
4
  "description": "2D rendering foundation",
5
5
  "main": "index.js",
6
6
  "module": "dist/plugin-renderer.esm.js",
@@ -40,9 +40,9 @@
40
40
  "lodash-es": "^4.17.21",
41
41
  "pixi.js": "^8.18.1",
42
42
  "resource-loader": "^4.0.0-rc4",
43
- "@combos-fun/engine": "0.1.22",
44
- "@combos-fun/inspector-decorator": "0.1.22",
45
- "@combos-fun/renderer-adapter": "0.1.22"
43
+ "@combos-fun/engine": "0.1.24",
44
+ "@combos-fun/inspector-decorator": "0.1.24",
45
+ "@combos-fun/renderer-adapter": "0.1.24"
46
46
  },
47
47
  "scripts": {
48
48
  "build": "node ../../scripts/build-package.mjs"