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

Animate CC 2017 (HTML5 Canvas) Dynamic Text Field Line Break?

Engaged ,
Jan 12, 2017 Jan 12, 2017

Copy link to clipboard

Copied

I cannot get the dynamic text field to display copy in paragraphs, it will only display text as one solid block of copy.

There must be some way to break up copy into paragraph blocks, but I can find no information on this.

Does anyone know?

Thanks.

Views

3.4K

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

LEGEND , Jan 12, 2017 Jan 12, 2017

According to the docs, createjs textfields don't support HTML text:

EaselJS v0.8.2 API Documentation : Text

but, you can use \n to indicate a return character:

this.side_copy.sidecopy_txt.text ="Operator benefits: \nComfort, less shock. Productivity.\n\nOwner benefits: \nFuel efficiency, less wasted energy, productivity, less wear & tear (less maintenance)\n\nOEM benefits: \nReduced service/warranty issues";

Votes

Translate

Translate
LEGEND ,
Jan 12, 2017 Jan 12, 2017

Copy link to clipboard

Copied

You're saying that when you press the Enter key, it ignores it?

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
Engaged ,
Jan 12, 2017 Jan 12, 2017

Copy link to clipboard

Copied

Here's the string:

this.side_copy.sidecopy_txt.text ="Operator benefits: Comfort, less shock. Productivity. Owner benefits: Fuel efficiency, less wasted energy, productivity, less wear & tear (less maintenance) OEM benefits: Reduced service/warranty issues";

This does not work:

this.side_copy.sidecopy_txt.text ="Operator benefits: Comfort, less shock. Productivity. <br><br>Owner benefits: Fuel efficiency, less wasted energy, productivity, less wear & tear (less maintenance) <br><br>OEM benefits: Reduced service/warranty issues";

What might? Thanks.

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
LEGEND ,
Jan 12, 2017 Jan 12, 2017

Copy link to clipboard

Copied

According to the docs, createjs textfields don't support HTML text:

EaselJS v0.8.2 API Documentation : Text

but, you can use \n to indicate a return character:

this.side_copy.sidecopy_txt.text ="Operator benefits: \nComfort, less shock. Productivity.\n\nOwner benefits: \nFuel efficiency, less wasted energy, productivity, less wear & tear (less maintenance)\n\nOEM benefits: \nReduced service/warranty issues";

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
Engaged ,
Jan 12, 2017 Jan 12, 2017

Copy link to clipboard

Copied

Thank you, how did you find that information?

I didn't see a link to that in he Adobe documentation, not that it would help, I can't find your solution on the EaselJS page, either.

Too bad Adobe couldn't incorporate that feature in the Animate interface somehow?

Thanks, again!

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
LEGEND ,
Jan 12, 2017 Jan 12, 2017

Copy link to clipboard

Copied

It's a common solution to the same problem in other languages, including ActionScript. Comes up a lot if you're trying to present an array as a list to the user. This ought to work:

somefield.text = anarray.join("\n");

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
LEGEND ,
Jan 12, 2017 Jan 12, 2017

Copy link to clipboard

Copied

LATEST

Indeed. Pretty much all languages support \n for newline, \t for tab, \" for literal quote, etc.

JavaScript character escape sequences · Mathias Bynens

These character sequences aren't strictly necessary, they're just convenient shortcuts. Much easier to type "Line1\nLine2" than "Line1" + String.fromCharCode(10) + "Line2" (10 is the ASCII code for a line feed).

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