Last week I posted a new module to our (brand new!) Module Warehouse. It’s the Tooltip module. I originally wrote this module as an example of how to develop Cell Components (which are called Capabilities in the UI). I really do intend to write a tutorial around this example, but for now, I decided to upload it to the Warehouse. You can of course get the code too: it’s in the unstable/ section of the wonderland-modules project (see this tutorial for instructions on how to download this, and other, module source code).
The Tooltip module displays a tooltip in the HUD when a user hovers over an Object in the world. To add the Tooltip Capability, right-click on the Object and select Properties… from the context menu to bring up the Object Editor. Then click the ‘+’ in the lower left-hand corner of the Object Editor (see picture below). Choose the Tooltip Capability from the dialog which appears and click OK. Then in the Object Editor, select Tooltip in the Capabilities list, enter the tooltip text on the right and click Apply.
The following shows what a tooltip with simple text looks like in-world:
What’s cool about the Tooltip Capability (if I do say so myself), is you can enter HTML text as well. Just enclose your text in the <html>…</html> tags. Although the available support for HTML is limited, I’ve tested some common tags like <br> (to achieve multi-line tooltips), <b>, <table>, and even <img>.
The property sheet below shows an example of displaying formatted text in a tooltip:
And here’s the result in-world: