If you’ve been following the news on the Project Wonderland web site, you’ll have seen an announcement of the +Spaces (“Positive Spaces”) EU project. One of the goals of the project is to enable interoperability between Project Wonderland and OpenSim. I’m not a big Second Life user and I’ve never used OpenSim, so I thought it was time to take a look at how to develop for OpenSim. As with most developer introductions, OpenSim offers a nice “Hello World!” example–which led me to wonder how hard it would be to easily add text to a Project Wonderland world.
At about the same time, Jordan released his tooltip component and it struck me that it would be cool if it was a proper object, not just a component. Of course, one of the benefits of developing in Java is that you get access to millions of lines of Java code and libraries that you can incorporate into your software. So it is with Jordan’s tooltip–it uses a Swing JLabel that can incorporate HTML.
So, how about a Hello World example for Project Wonderland? Easy… just download the Poster module from the Warehouse. Once installed, you can select “Poster” from the Insert Object dialogue to get a Hell0 World poster.
To edit the text, right click on the poster and select “Set Text…” from the context menu. Enter the text in the text area of the dialogue box. You can preview the text (by clicking the Preview button) and accept it by clicking the OK button. The dialogue box also enables you to set your poster to be a “Billboard” (always orients towards the camera). Like the Tooltip component, the Poster uses a Swing JLabel to render the text, so you can enter HTML in the text area. For example:
When you click OK, this will update the Poster as illustrated below:
You can use more or less any HTML, but there are a few restrictions due to Swing. So, now you’ve got an object into which you can write any text, or insert anything that can be rendered via HTML. But there’s more… because it’s a first-class object in Project Wonderland it can also have capabilities applied to it. For example, a clickable-link, or audio.