Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

a problem with the bitmap text when the maxWidth is set and the last letter is space #6717

Open
wooseok123 opened this issue Jan 18, 2024 · 0 comments

Comments

@wooseok123
Copy link

Version

  • Phaser Version:
    3.60.0
  • Operating system:
    Window
  • Browser:
    Chrome

Description

After i set the BitmapText maxWidth, i was typing some texts. Then i analyzed the bitmap character property by using getTextBounds.
If i type 'space' (default wordwrapCode) at the very last position, it doesn't recognize the white space letter.

error

between idx 8 and 9, i definetely type 'space' but, there isn't any letter. Actually, it do recognize the idx.
(As you can see, idx property is increased but i property isn't increased)

if i try to use 'setCharacterTint' at this case, after i type like this, it highlight the very next one. (not the current one)

Example Test Code

// bitmapText
    this.curTypingText = this.add
      .bitmapText(
        1162,
        this.curTextY[this.curExamListIdx],
        'pretendard_bold',
        '',
        34,
      )
      .setOrigin(0);

// set MaxWidth
this.curTypingText.maxWidth = 629;

// It is just an example. 
this.input.on('keydown',(e) => this.curTypingText.setText([...curText, e.code].join("") );

// after type 'space' at the last letter (right before the maxwidth), it doesn't add space letter at their array.

Additional Information

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants