My mistake, I did have the wumedia library (automatic when updating from the
trunk), but I had not named the embedded font correctly.

For what it’s worth, this are the steps for using TextField3D with Flash
CS3:
1. In the fla, open the library, and at the pull down select New Font...
2. In the font's properties dialog, enter "myArial" (or anything) for name,
and select the desired font and style.
3. Open the font's linkage properties, select Export for ActionScript, leave
the base class as flash.text.Font, and for the Class, enter "myArialClass".
4. In the AS, put:
   import wumedia.vector.VectorText;
   Font.registerFont(myArialClass); // Must match the font class name given
in the linkage properties
   VectorText.extractFont(root.loaderInfo.bytes);
   var textfield:TextField3D = new TextField3D("Arial", {textColor:0x0000FF,
text:"Hello!", size:100, leading:500, kerning:0, textWidth:10000,
align:"TL"});
   view.scene.addChildren( textfield ); // Assumes already have Away3D scene
and renderer set up.

A few notes:
* The first parameter in the TextField3D constructor must be the actual font
name (e.g. "Arial"), not the link properties class name ("myArialClass").

* The text will have zero thickness and will lie in the X-Y plane.  The text
direction is towards +X.  The starting point is according to the align
parameter, e.g. "TL" means the top left corner of the string will be at
0,0,0.

* TextField3D extends Mesh so you can move it around with x, y, z,
rotationX, etc. properties, but the text color, string, and other properties
can only be set via the init object when it is instantiated.

Thanks, Li, for this!  Let me know if my notes are not correct...

----------------
From: [email protected] [mailto:[email protected]] On
Behalf Of Li
Sent: Wednesday, June 17, 2009 2:26 PM
To: [email protected]
Subject: [away3d] Re: What is the latest/best/simplest 3d text method to
use?

You should download the latest away3d trunk, that comes with a few other
libs as well, such as gs's TweenMax and stuff like that. When you do, make
sure you get the wumedia package. It should come with away3d from now on,
its a really cool swf parsing library.
On Wed, Jun 17, 2009 at 7:17 PM, Ralph Brooker <[email protected]> wrote:

Li,
TextField3D needs a couple of classes that I cannot find in the updated
Away3D trunk:

       import wumedia.parsers.swf.DefineFont;
       import wumedia.vector.VectorText;

Can you help?
Thanks!

----------------------------



From: [email protected] [mailto:[email protected]] On
Behalf Of Li
Sent: Wednesday, June 17, 2009 12:53 PM
To: [email protected]
Subject: [away3d] Re: What is the latest/best/simplest 3d text method to
use?

I don't use Flash for coding, so I can't tell you much, but I think its
something like that. I'm sure its highly googleable.
On Wed, Jun 17, 2009 at 5:00 PM, Ralph Brooker <[email protected]> wrote:

Thanks, Li.  I assume the statement:

   [Embed(systemFont="Arial", fontName="_Arial",
mimeType="application/x-font")]
is a Flex directive?  For those of us using Flash CS3 environment, can you
give some tips on how to embed the font?  Is it as simple as creating a new
Font in the library and defining the linkage name as “Arial”?





From: [email protected] [mailto:[email protected]] On
Behalf Of Li
Sent: Wednesday, June 17, 2009 11:42 AM
To: [email protected]
Subject: [away3d] Re: What is the latest/best/simplest 3d text method to
use?

Ok, its online.
It will be limited for the time being, but I guess it will help you out
anyways.
Perhaps if there are minor things you need, don't hesitate to tell me.

Usage is something like this:

[Embed(systemFont="Arial", fontName="_Arial",
mimeType="application/x-font")]
        public var Arial:Class;

Font.registerFont(Arial);
            VectorText.extractFont(root.loaderInfo.bytes);
           
            var textfield:TextField3D = new TextField3D("_Arial",
{textColor:0xFF0000, text:"Hey", size:200, leading:20, kerning:0,
textWidth:1000, align:"TL"});
            textfield.x -= textfield.objectWidth/2;
            textfield.y += textfield.objectHeight/2;
            _scene.addChild(textfield);
On Wed, Jun 17, 2009 at 3:27 PM, Ralph Brooker <[email protected]> wrote:
Li, I would also very much appreciate it if you could commit and explain
your dynamic vector text capability!  We are developing materials teaching
topics like latitude, longitude, and satellite orbits, so the ability to
apply 3D labels would help students better understand the concepts we are
explaining.
Thanks in advance,
Ralph
 
From: [email protected] [mailto:[email protected]] On
Behalf Of Li
Sent: Wednesday, June 17, 2009 10:12 AM
To: [email protected]
Subject: [away3d] Re: What is the latest/best/simplest 3d text method to
use?
 
Hey,

I'll commit dynamic vector text capability in away3d if you need it. Im
still developing it, but if you think it would help i could commit it and
shortly explain how to use it?
On Wed, Jun 17, 2009 at 2:25 PM, MadMax <[email protected]> wrote:

Thankyou for the reply.

I like the globe example, very nice.

I've had a go prior to asking, and sounds like the sort of thing I was
trying to make work and couldn't get the text to sit above the objects
and got really frustrated and abandoned my attempt at a game, for a
month now.

I want to display the numbers 0 -5 , or a ? or the words King, Queen,
Rook , Bishop , Knight above the 3d objects and chess board. Such a
simple concept yet it's frustrated me no end no getting desired
result.

I may want to have the text rotate while they sit above the object. I
don't want the text to have a background.

Sounds like I could have had a zsort issue.

Any links to code anywhere, or is the 3d text going to be implemented
any time soon?

Cheers,
Max

On Jun 17, 9:43 pm, elguapoloco <[email protected]>
wrote:
> Personally I would consider 2 approaches.
>
> If the text needs to be full 3D (rotated, with perspective, etc) you
> could just use a function to generate dynamically a bitmap with the
> desired text and use that as a texture on a Plane or use a
> MovieclipMaterial (if the text or sprite has animation). This was a
> little experiment using Dynamic text + MovieMaterial +
Plane:http://clients.stcassociates.com/stc/rss3D/index.html
>
> If the text just needs to z sorted and always faces the camera, I
> would use Sprite2D to display it. The advantage of this is that the
> user can always read the text.
> This is an example of Sprite2D text in a project  I am working
on:http://clients.stcassociates.com/stc/locationsMap/demo2/STC_Locations...
>
> The base is the same in both approaches. You generate a sprite with a
> textfield draw it into BitmapData and use that as a texture.
>
> There is a branch with a Type class inside Away3D but I haven't tried
> it yet.
>
> Hope this helps,
>
> Cheers,
>
> Jerome.
 




Reply via email to