As mentioned on the about page Tweetpond displays tweet content using standard Flash TextFields that are rendered as part of the 3D scene. This is often called billboarding or point sprites.
Our DisplayObject2D implementation is based on the following sources:
Our implementation solves the Z-ordering issues reported when using DisplayObject2D with Papervision3D 2.0.
We recently received a request to share our version with the community so here you go! You can download the ActionScript3 class files below:
This code is released under the MIT licence, same as Papervision3D. To get an idea on how to use this class please see this post by Blitz Agency and source comments.
Please feel free to share your project that makes use of DisplayObject2D below!


3 Comments
A reader recently asked for some examples on how to use the DisplayObject2D class so I’ve attached some example code below to illustrate.
The magic is in having everything on their own individual layers that Papervision3D can the z-order correctly. I also highly recommend installing http://www.monsterdebugger.com/ so you can see what’s happening in your application in real time. Good luck!
var parentLayer:ViewportLayer;
var vpl:ViewportLayer;
// create an empty parent viewport layer and add it to the container
parentLayer = new ViewportLayer(viewport, null);
viewport.containerSprite.addLayer(parentLayer);
// create shape
var shape = new Sphere(material, SIZE);
// create layer and add to scene
shape.useOwnContainer = true;
vpl = parentLayer.getChildLayer(shape, true);
scene.addChild(shape);
// create text box (movieclip)
var box = new Box();
//...set box properties here...
// create do2d that encapsulates the movieclip
var label = new DisplayObject2D(box as DisplayObject, parentLayer, 0, null, SIZE*1.25, 0);
// create layer and add to scene
label.useOwnContainer = true;
vpl = parentLayer.getChildLayer(label, true);
scene.addChild(label);
Hello from Spain,
“A reader recently asked for some examples on how to use the DisplayObject2D class so I’ve attached some example code below to illustrate.”
I started to program in papervision recently not for profesional job. I readed your post.
¿Could you give me an code source example for a movieclip like ‘circle’?
Thank for all,
Hi Fernando, sounds like you’re trying to run the original example from Blitz Agency.
“Circle” is not defined in ActionScript at all, it is a movieclip you can find in the Library of the DisplayObject2DTest.fla project:
You will also notice under the “linkage” column how this movieclip has been exported to ActionScript as class “Circle”. In the Library, right click on the Circle and select Properties to view and change symbol properties.
Hope this helps.
Cheers, Jussi