This is G o o g l e's cache of http://www.flashsandy.org/forum/index.php?act=Print&client=printer&f=17&t=121 as retrieved on 31 Jul 2007 19:33:18 GMT.
G o o g l e's cache is the snapshot that we took of the page as we crawled the web.
The page may have changed since that time. Click here for the current page without highlighting.
This cached page may reference images which are no longer available. Click here for the cached text only.
To link to or bookmark this page, use the following url: http://www.google.com/search?q=cache:xLBNjP01LL8J:www.flashsandy.org/forum/index.php%3Fact%3DPrint%26client%3Dprinter%26f%3D17%26t%3D121+act%3DPrint+%22index+php%22+-lofiversion+site:www.flashsandy.org&hl=en&ct=clnk&cd=72


Google is neither affiliated with the authors of this page nor responsible for its content.
These terms only appear in links pointing to this page: act print index php

Printable Version of Topic

Click here to view this topic in its original format

Sandy's Forum _ AS2 1.x versions _ Drawing text

Posted by: cesarico Aug 28 2006, 09:05 AM

Hello

I am new to Sandy, Flash and ActionScript; I've been using Sandy and Mtasc (I don't have the macromedia editor) to create a swf that loads a set of points and uses it to draw a rotating 3D surface.

So far I haven't got much problems, but now I am trying to add text beside the graphics axis and I don't see any easy way to do it.

As I don't see any Sandy primitive to draw text I tried to create a surface and apply to it a Movie Skin where the movie is another clip where I would have previously drawn the dynamic text that I want. I haven't got it working, but this is probably because of my limited ActionScript skills. Does anybody have a working sample of something similar to what I am trying to do? Am I in the right direction?


thank you

Posted by: kiroukou Aug 28 2006, 10:05 AM

hi cesarico,
indeed the solution you tried is the easiest way to do this currently.

Otherwise you can use the Ase file parser to load a text object modelized with a specific editor like 3DS.

Posted by: cesarico Aug 28 2006, 03:57 PM

QUOTE(kiroukou @ Aug 28 2006, 12:05 PM) *

Otherwise you can use the Ase file parser to load a text object modelized with a specific editor like 3DS.


well, this would not really suit my need, because I want to display text from a data source, not a text that I could have modelized before hand.

I am trying to use the MovieSkin, but beside some side effect when I invoke the createEmptyMovieClip (I guess this is not a Sandy problem but my own flash inexperience) I am having trouble to paste the movie skin into the surface, it shows distorted. I guess it has some relation with the "UVCoordinate" system, I don't understand how it works.

This is a piece of the code that I am trying right now:

CODE
    ...
    var xlegendMc = mc.createEmptyMovieClip( "someLegend", mc.getNextHighestDepth());
    xlegendMc.createTextField( "zero", 1000, 0,0, 200, 20 );
    xlegendMc.zero.text="hellooooooooooooo world";
    var xlegendSkin = new MovieSkin(xlegendMc, false );
    var xlegend:Plane3D = new Plane3D( 200, 20,  1, "quad" );
    xlegend.setSkin( xlegendSkin );
    theWorld.addChild( xlegend );
    ...


By reading the docs I see that at some point I should add a call like
CODE
    xlegend.addUVCoordinate(1,1);

in order to map correctly the skin into the surface, but I don't see a clear example of which values should I give to the UVCoordinates.

Posted by: kiroukou Aug 28 2006, 07:06 PM

Hi
Yes the text will be distort! That's normal, it is due to the texture system that Sandy use. It is fast but non accurate.
You can reduce this effect by increase the Plane quality.

The UV coordinates are allready generated by the Plane primitive, so you don't have to care about that.

Posted by: cesarico Aug 29 2006, 06:29 AM

QUOTE(kiroukou @ Aug 28 2006, 09:06 PM) *

...it is due to the texture system that Sandy use. It is fast but non accurate.
You can reduce this effect by increase the Plane quality.


ok, I see; I've been trying different combinations but it is not easy to get a readable text, at least not with the detail that I am looking for.

I think I should reconsider the problem that I am trying to solve: I want to "annotate" a 3D model with readable labels, rather than "decorate" its faces with texts. I don't need the texts mapped into a surface; actually, I would prefer the text not to be mapped, but shown to the camera "as is", in 2D, no matter where the camera is. It may seem that this is not a 3D problem, therefore not to be implemented with Sandy, but it is as long as I want the "2D labels" located in the view port attached to some 3D point, moving on the screen as the point is translated or the camera moved.

I am considering to extend the Object3D to develop a "primitive" for this need, do you think it is feasible?

Posted by: kiroukou Aug 29 2006, 07:04 AM

What you are considering is exacly the purpose of Sprite2D.

Apply this MovieSkin to a Sprite2D object, and that will be better wink.gif

++

Posted by: cesarico Aug 29 2006, 09:59 AM


BRAVO!!! this is exactly what I was looking for , thank you very much smile.gif

just for the record, the code that I am dealing with looks somehow like this:

CODE
    ...
    var xlegendMc = mc.createEmptyMovieClip( "someLegend", mc.getNextHighestDepth());
    xlegendMc.createTextField( "zero", 1000, 0,0, 200, 20 );
    xlegendMc.zero.text="hellooooooooooooo world";
    var xlegendSkin = new MovieSkin(xlegendMc, false );
    var xlegend:Sprite2D = new Sprite2D( 1 );
    xlegend.setSkin( xlegendSkin );
    theWorld.addChild( xlegend );
    ...

Powered by Invision Power Board (http://www.invisionboard.com)
© Invision Power Services (http://www.invisionpower.com)