A couple of days ago I had a look into Five3D just because I had some time on my hands and I wanted to check out Five3D for a while now. One big thing I missed in this vector based 3D engine was word wrapping for text. A Google search led me to an inaccessible blog, so I decide to write the word wrapping myself.
Download the file here: Updated DynamicText3D.as (Compatible with v2.1.2)
Usage:
- var text3d: DynamicText3D = new DynamicText3D(HelveticaBold);
- text3d.size = 40;
- text3d.color = 0xffffff;
- // set a maximum width for the text
- text3d.maxWidth = 220;
- // flick word wrapping on
- text3d.wordWrap = true;
- text3d.text = "Something long enough to actually wrap...";
- // Traces out the height of the text
- trace("text3d.textHeight")
I know it’s not perfect, but it’s working for me! 😉