Text jittering with Rex Typing Plugin

Hey guys,

I’m using Rex’ Plugins for Typing and BBCode Text.
Unfortunately the text wrapping is a little wiggly.

Example:
“This is the first line. After this one the text ist wrapped.
Now the second line is here.”

The word “Now” is on line two. But while typing it’s displayed in the first line first and then jumps to the second line. I uploaded a video to demonstrate this.

You can see this in the first Text with “Choose an…” and when talking to the blonde character with "…is already…

Here’s the code:

const textboxWidth = 700
const textPadding = 20

this.text = this.scene.add.rexBBCodeText(x, y, '', getTextStyle(textboxWidth))
this.text.setScrollFactor(0).setOrigin(0, 0).setPadding(texPadding)

this.typer = this.scene.textTyper.add(this.text)
this.typer.start(text, 30)

...

const getTextStyle = (width) => {
    return {
        lineSpacing: 10,
        fontFamily: DEFAULT_FONT,
        wrap: { // For bbcode text
            mode: 'word',
            width,
        },
        wordWrap: { width }, // For normal text
    }
}

Any ideas? I would be very greatful.

Best regards
Nick

TextTyping won’t add new-line (\n) during typing, therefore typing content will be wrapped by BBCodeText game object.

To solve this issue, try to insert ‘\n’ into typing content at typing start.

I could add this feature into plugin later, add to TODO.

Thank you very much for your reply. So you mean I have to manually set where the lines should break? That would be very inconvenient for me, because I don’t know how much characters fit in the box. Maybe I’m wrong, but I thought that’s what the textwrap is for :thinking:

Add wrap parameter to run text-wrap before typing, see this demo, line 34. Please get latest version of minify file.
Default value of this wrap is false.

OMG you’re a real hero, Rex! Thank you so much - it’s working just fine!

Normally I use the npm releases. Do you have time to release an update there, too? Otherwise I just stick with the static URLs for the moment.

Will upgrade npm package next week.

1 Like