mimshwright / pixi-tagged-text

A component for pixi similar to Text that supports multiple styles in a single component as well as inline images.
MIT License
31 stars 15 forks source link

How to set text in middle when use "lineHeight" #228

Open q1998763 opened 2 years ago

q1998763 commented 2 years ago

code: const t = new TaggedText('hello world', { default: { wordWrap: true, wordWrapWidth: 50, valign: 'middle', lineHeight: 50 } }, { debug: true })

I got image

But I want the text in vertical middle. Sorry for my poor english.

mimshwright commented 2 years ago

Vertical align will change how the whole paragraph appaers within it's bounding box but doesn't work on each line. I've honestly never tried this before and I'm not sure whether it should be considered a bug.

You might try adjustBaseline to bush the line down to the middle