MovableText         Billboard-style Text in 3D


What is it?

This class will allow you to write some text in the 3D world, the features are:

  • The text is attached to a -SceneNode and therefore follows its movement and get smaller when further away
  • The text is always facing the camera (like a -Billboard)
  • The text can be positioned horizontally and vertically (center, left, etc...)
  • The text can be translated on the UNIT_Y vector

How to use it

This class is very easy to use:

Ogre::MovableText* msg = new Ogre::MovableText("TXT_001", "this is the caption");
msg->setTextAlignment(Ogre::MovableText::H_CENTER, Ogre::MovableText::V_ABOVE); // Center horizontally and display above the node
/* msg->setAdditionalHeight( 2.0f ); //msg->setAdditionalHeight( ei.getRadius() ) // apparently not needed from 1.7*/
mNode->attachObject(msg);

OGRE v2.1 and Above Notes

To use this with OGRE 2.1 or newer versions, you can use the adapted snippet below:

 Plugin disabled

Plugin attach cannot be executed.

Instructions can be found in the zip file. Please note that this adapted snippet is not compatible with previous OGRE versions anymore.

OGRE v1.7 and Above Notes

To use this with OGRE 1.7 or newer versions, you need this resource package below:

 Plugin disabled

Plugin attach cannot be executed.

(A silly, easy to make mistake: don't forget to add the directory in the above archive to your resources.)

OGRE v1.6 and Below Notes

  • Because of the latest modifications to the source to work with 1.7 and above, you may need to change BlueHighway-8 to BlueHighway if you're using 1.6 or below. (Or maybe you should consider updating your OGRE version :-))
  • To use MovableText on Ogre 1.6.x (Shoggoth), just add this:
virtual void visitRenderables(Ogre::Renderable::Visitor* visitor, bool debugRenderables = false) {};

in the public method section.

  • Default font: See note on the discussion page. (TODO: integrate content to this main page)
  • Text is displayed from the center of the -SceneNode, setAdditionalHeight() allows you to translate the text on the UNIT_Y vector.
  • For Mogre, you can use MOGRE MovableText

Source code

[+] MovableText.h

[+] MovableText.cpp