• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

Text wrap for dynamic text box for Animate HTML5 (Canvas) app

Participant ,
Apr 18, 2019 Apr 18, 2019

Copy link to clipboard

Copied

I've got a dynamic text box (txt_correct) into which I add text of varying lengths at runtime. It's set to multiline, but when the text is over a certain length, because it doesn't text wrap, the tail end of the text does not show. How do I get it to text wrap using JavaScript or from within Animate? Thanks

Views

1.2K

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

Participant , Apr 23, 2019 Apr 23, 2019

I found out what the problem was. I was keeping track of the problems users were doing and presenting them in the form 1,2,3, etc. I was doing it without spaces, so what I was putting in the box was treated as one word, which, of course, doesn't text wrap. Now I'm putting in spaces, 1, 2, 3 etc., and it wraps just fine.

Votes

Translate

Translate
LEGEND ,
Apr 18, 2019 Apr 18, 2019

Copy link to clipboard

Copied

On fixed-width dynamic textfields, text wraps and the textfield vertically expands automatically as needed. So since what you're describing is not normal behavior, we're going to need more detail.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Participant ,
Apr 18, 2019 Apr 18, 2019

Copy link to clipboard

Copied

I just added three dynamic text boxes and set the positions and size. Should I not set the vertical height? I add text on the fly.

root.txt_correct.text = "Correct: " + root.correctAnswers;

root.txt_incorrect.text = "Incorrect: " + root.incorrectAnswers;

root.txt_given_answers.text = "Given: " + root.givenAnswers;

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Participant ,
Apr 23, 2019 Apr 23, 2019

Copy link to clipboard

Copied

LATEST

I found out what the problem was. I was keeping track of the problems users were doing and presenting them in the form 1,2,3, etc. I was doing it without spaces, so what I was putting in the box was treated as one word, which, of course, doesn't text wrap. Now I'm putting in spaces, 1, 2, 3 etc., and it wraps just fine.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines