UNPKG

pixi.js

Version:

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

1 lines 2.27 kB
{"version":3,"file":"PrepareSystem.mjs","sources":["../../src/prepare/PrepareSystem.ts"],"sourcesContent":["import { ExtensionType } from '../extensions/Extensions';\nimport { PrepareUpload } from './PrepareUpload';\n\nimport type { System } from '../rendering/renderers/shared/system/System';\n\n/**\n * The prepare system provides renderer-specific plugins for pre-rendering DisplayObjects. This is useful for\n * asynchronously preparing and uploading to the GPU assets, textures, graphics waiting to be displayed.\n *\n * Do not instantiate this plugin directly. It is available from the `renderer.prepare` property.\n * @example\n * import 'pixi.js/prepare';\n * import { Application, Graphics } from 'pixi.js';\n *\n * // Create a new application (prepare will be auto-added to renderer)\n * const app = new Application();\n * await app.init();\n * document.body.appendChild(app.view);\n *\n * // Don't start rendering right away\n * app.stop();\n *\n * // Create a display object\n * const rect = new Graphics()\n * .beginFill(0x00ff00)\n * .drawRect(40, 40, 200, 200);\n *\n * // Add to the stage\n * app.stage.addChild(rect);\n *\n * // Don't start rendering until the graphic is uploaded to the GPU\n * app.renderer.prepare.upload(app.stage, () => {\n * app.start();\n * });\n * @category rendering\n * @advanced\n */\nexport class PrepareSystem extends PrepareUpload implements System\n{\n /** @ignore */\n public static extension = {\n type: [\n ExtensionType.WebGLSystem,\n ExtensionType.WebGPUSystem,\n ],\n name: 'prepare',\n } as const;\n\n /** Destroys the plugin, don't use after this. */\n public destroy(): void\n {\n clearTimeout(this.timeout);\n this.renderer = null;\n this.queue = null;\n this.resolves = null;\n }\n}\n"],"names":[],"mappings":";;;;AAqCO,MAAM,sBAAsB,aACnC,CAAA;AAAA;AAAA,EAWW,OACP,GAAA;AACI,IAAA,YAAA,CAAa,KAAK,OAAO,CAAA,CAAA;AACzB,IAAA,IAAA,CAAK,QAAW,GAAA,IAAA,CAAA;AAChB,IAAA,IAAA,CAAK,KAAQ,GAAA,IAAA,CAAA;AACb,IAAA,IAAA,CAAK,QAAW,GAAA,IAAA,CAAA;AAAA,GACpB;AACJ,CAAA;AAAA;AAnBa,aAAA,CAGK,SAAY,GAAA;AAAA,EACtB,IAAM,EAAA;AAAA,IACF,aAAc,CAAA,WAAA;AAAA,IACd,aAAc,CAAA,YAAA;AAAA,GAClB;AAAA,EACA,IAAM,EAAA,SAAA;AACV,CAAA;;;;"}