From b271accaf019efed43339ed0ff960fb0015f7b48 Mon Sep 17 00:00:00 2001 From: Jaro Vanderheijden Date: Sat, 20 Aug 2022 12:29:47 +0200 Subject: [PATCH] Add raw character index to bitmap text bounds --- src/gameobjects/bitmaptext/GetBitmapTextSize.js | 1 + types/phaser.d.ts | 6 +++++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/src/gameobjects/bitmaptext/GetBitmapTextSize.js b/src/gameobjects/bitmaptext/GetBitmapTextSize.js index 77340aa54..040ebc352 100644 --- a/src/gameobjects/bitmaptext/GetBitmapTextSize.js +++ b/src/gameobjects/bitmaptext/GetBitmapTextSize.js @@ -384,6 +384,7 @@ var GetBitmapTextSize = function (src, round, updateOrigin, out) characters.push({ i: charIndex, + idx: i, char: text[i], code: charCode, x: (glyph.xOffset + x) * scale, diff --git a/types/phaser.d.ts b/types/phaser.d.ts index a2c72f01b..807ce120d 100644 --- a/types/phaser.d.ts +++ b/types/phaser.d.ts @@ -62295,9 +62295,13 @@ declare namespace Phaser { */ type BitmapTextCharacter = { /** - * The index of this character within the BitmapText text string. + * The index of this character within the BitmapText wrapped text string. */ i: number; + /** + * The index of this character within the BitmapText text string. + */ + idx: number; /** * The character. */