Files
nothoughts/node_modules/pixi.js/lib/scene/text/Text.mjs.map
2025-08-04 18:57:35 +02:00

1 line
3.1 KiB
Plaintext

{"version":3,"file":"Text.mjs","sources":["../../../src/scene/text/Text.ts"],"sourcesContent":["import { AbstractText, ensureOptions } from './AbstractText';\nimport { CanvasTextMetrics } from './canvas/CanvasTextMetrics';\nimport { TextStyle } from './TextStyle';\n\nimport type { View } from '../../rendering/renderers/shared/view/View';\nimport type { TextOptions, TextString } from './AbstractText';\nimport type { TextStyleOptions } from './TextStyle';\n\n/**\n * A Text Object will create a line or multiple lines of text.\n *\n * To split a line you can use '\\n' in your text string, or, on the `style` object,\n * change its `wordWrap` property to true and and givae the `wordWrapWidth` property a value.\n *\n * The primary advantage of this class over BitmapText is that you have great control over the style of the text,\n * which you can change at runtime.\n *\n * The primary disadvantages is that each piece of text has it's own texture, which can use more memory.\n * When text changes, this texture has to be re-generated and re-uploaded to the GPU, taking up time.\n * @example\n * import { Text } from 'pixi.js';\n *\n * const text = new Text({\n * text: 'Hello Pixi!',\n * style: {\n * fontFamily: 'Arial',\n * fontSize: 24,\n * fill: 0xff1010,\n * align: 'center',\n * }\n * });\n * @memberof scene\n */\nexport class Text\n extends AbstractText<TextStyle, TextStyleOptions>\n implements View\n{\n public readonly renderPipeId: string = 'text';\n\n /**\n * @param {text.TextOptions} options - The options of the text.\n */\n constructor(options?: TextOptions);\n /** @deprecated since 8.0.0 */\n constructor(text?: TextString, options?: Partial<TextStyle>);\n constructor(...args: [TextOptions?] | [TextString, Partial<TextStyle>])\n {\n const options = ensureOptions(args, 'Text');\n\n super(options, TextStyle);\n }\n\n protected _updateBounds()\n {\n const bounds = this._bounds;\n const anchor = this._anchor;\n\n const canvasMeasurement = CanvasTextMetrics.measureText(\n this._text,\n this._style\n );\n\n const { width, height } = canvasMeasurement;\n\n bounds.minX = (-anchor._x * width);\n bounds.maxX = bounds.minX + width;\n bounds.minY = (-anchor._y * height);\n bounds.maxY = bounds.minY + height;\n }\n}\n"],"names":[],"mappings":";;;;;AAiCO,MAAM,aACD,YAEZ,CAAA;AAAA,EASI,eAAe,IACf,EAAA;AACI,IAAM,MAAA,OAAA,GAAU,aAAc,CAAA,IAAA,EAAM,MAAM,CAAA,CAAA;AAE1C,IAAA,KAAA,CAAM,SAAS,SAAS,CAAA,CAAA;AAZ5B,IAAA,IAAA,CAAgB,YAAuB,GAAA,MAAA,CAAA;AAAA,GAavC;AAAA,EAEU,aACV,GAAA;AACI,IAAA,MAAM,SAAS,IAAK,CAAA,OAAA,CAAA;AACpB,IAAA,MAAM,SAAS,IAAK,CAAA,OAAA,CAAA;AAEpB,IAAA,MAAM,oBAAoB,iBAAkB,CAAA,WAAA;AAAA,MACxC,IAAK,CAAA,KAAA;AAAA,MACL,IAAK,CAAA,MAAA;AAAA,KACT,CAAA;AAEA,IAAM,MAAA,EAAE,KAAO,EAAA,MAAA,EAAW,GAAA,iBAAA,CAAA;AAE1B,IAAO,MAAA,CAAA,IAAA,GAAQ,CAAC,MAAA,CAAO,EAAK,GAAA,KAAA,CAAA;AAC5B,IAAO,MAAA,CAAA,IAAA,GAAO,OAAO,IAAO,GAAA,KAAA,CAAA;AAC5B,IAAO,MAAA,CAAA,IAAA,GAAQ,CAAC,MAAA,CAAO,EAAK,GAAA,MAAA,CAAA;AAC5B,IAAO,MAAA,CAAA,IAAA,GAAO,OAAO,IAAO,GAAA,MAAA,CAAA;AAAA,GAChC;AACJ;;;;"}