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">

34 lines (30 loc) 1.05 kB
'use strict'; var BatchableSprite = require('../sprite/BatchableSprite.js'); "use strict"; class BatchableHTMLText extends BatchableSprite.BatchableSprite { /** * Creates an instance of BatchableHTMLText. * @param renderer - The renderer instance to be used. */ constructor(renderer) { super(); this.generatingTexture = false; this._renderer = renderer; renderer.runners.resolutionChange.add(this); } /** Handles resolution changes for the HTML text. If the text has auto resolution enabled, it triggers a view update. */ resolutionChange() { const text = this.renderable; if (text._autoResolution) { text.onViewUpdate(); } } /** Destroys the BatchableHTMLText instance. Returns the texture promise to the renderer and cleans up references. */ destroy() { this._renderer.htmlText.returnTexturePromise(this.texturePromise); this.texturePromise = null; this._renderer = null; } } exports.BatchableHTMLText = BatchableHTMLText; //# sourceMappingURL=BatchableHTMLText.js.map