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

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

Participant ,
Apr 18, 2019 Apr 18, 2019

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

1.4K
Translate
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.

Translate
LEGEND ,
Apr 18, 2019 Apr 18, 2019

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.

Translate
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

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;

Translate
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
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.

Translate
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