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.
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";
Copy link to clipboard
Copied
You're saying that when you press the Enter key, it ignores it?
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.
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";
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!
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");
Copy link to clipboard
Copied
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).