New Module: Poster

Inspiration comes from all kinds of places. The latest module in the Project Wonderland Module Warehouse was inspired by two events: Jordan’s tooltip component and the +Spaces EU Project.

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.

Hello World!

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:

Entering HTML in the Poster

When you click OK, this will update the Poster as illustrated below:

Project Wonderland Poster

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.

About these ads

9 Responses to New Module: Poster

  1. Nigel Wynne says:

    Cool!!!

  2. nnjones says:

    This is definitely great! (The other comment already said it so succinctly.)

  3. MaggieL says:

    I love it!

    And it’s *so* much more versatile than SL-style hovertext.

    I hope the +Spaces people are in contact with the Architecture Working Group/VWRAP folks; if not I can arrange introductions.

  4. MaggieL says:

    Does the actually scale the img in Swing?

    I didn’t think Swing was that smart, and I can’t get that to work in a mockup.

  5. MaggieL says:

    Oh, poo.

    I typed an img tag and of course it disappeared. Just does img style=”width:nnn height:mmm;” actually scale the image to match the style in Swing?

  6. MaggieL says:

    Kudos for finding any docs on what HTML Swing actually does support. Although “empty tag” doesn’t mean “no attributes” in this context.

    We don’t a full HTML renderer in Swing (although that would sure be nice!), and scaling of IMGs would be a luxury. But often it’s hard to know what HTMLage is actually going to be noticed by Swing.

    My experience has been that in the absence of strict specs, experimentation is the only way to find out. I often use the Beanshell frame() method for those experiments, right out of the jEdit Beanshell console.

    No reason I can think of not to do that in-world right on a Poster object, though.

  7. Jess says:

    And this is why I love http://www.virtualnorthstar.com. Stunning posts.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

Follow

Get every new post delivered to your Inbox.

Join 54 other followers

%d bloggers like this: