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.2 kB
{"version":3,"file":"RenderTexture.mjs","sources":["../../../../../src/rendering/renderers/shared/texture/RenderTexture.ts"],"sourcesContent":["import { TextureSource } from './sources/TextureSource';\nimport { Texture } from './Texture';\n\nimport type { TextureSourceOptions } from './sources/TextureSource';\n\n/**\n * A render texture, extends `Texture`.\n * @see {@link Texture}\n * @category rendering\n * @advanced\n */\nexport class RenderTexture extends Texture\n{\n /**\n * Creates a RenderTexture. Pass `dynamic: true` in options to allow resizing after creation.\n * @param options - Options for the RenderTexture, including width, height, and dynamic.\n * @returns A new RenderTexture instance.\n * @example\n * const rt = RenderTexture.create({ width: 100, height: 100, dynamic: true });\n * rt.resize(500, 500);\n */\n public static create(options: TextureSourceOptions): RenderTexture\n {\n // Pass dynamic to the RenderTexture constructor if present in options\n const { dynamic, ...rest } = options;\n\n return new RenderTexture({\n source: new TextureSource(rest),\n dynamic: dynamic ?? false,\n });\n }\n\n /**\n * Resizes the render texture.\n * @param width - The new width of the render texture.\n * @param height - The new height of the render texture.\n * @param resolution - The new resolution of the render texture.\n * @returns This texture.\n */\n public resize(width: number, height: number, resolution?: number): this\n {\n this.source.resize(width, height, resolution);\n\n return this;\n }\n}\n"],"names":[],"mappings":";;;;AAWO,MAAM,sBAAsB,OACnC,CAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EASI,OAAc,OAAO,OACrB,EAAA;AAEI,IAAA,MAAM,EAAE,OAAA,EAAS,GAAG,IAAA,EAAS,GAAA,OAAA,CAAA;AAE7B,IAAA,OAAO,IAAI,aAAc,CAAA;AAAA,MACrB,MAAA,EAAQ,IAAI,aAAA,CAAc,IAAI,CAAA;AAAA,MAC9B,SAAS,OAAW,IAAA,KAAA;AAAA,KACvB,CAAA,CAAA;AAAA,GACL;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EASO,MAAA,CAAO,KAAe,EAAA,MAAA,EAAgB,UAC7C,EAAA;AACI,IAAA,IAAA,CAAK,MAAO,CAAA,MAAA,CAAO,KAAO,EAAA,MAAA,EAAQ,UAAU,CAAA,CAAA;AAE5C,IAAO,OAAA,IAAA,CAAA;AAAA,GACX;AACJ;;;;"}