Skip to main content

History: MovableText

Preview of version: 12

REDIRECT plugin: The redirection to 'https://ogrecave.github.io/ogre/api/latest/class_ogre_1_1_font.html#a8dfa73e19f80225c6b71c7a27338ce5a' is disabled in preview mode.

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:

Copy to clipboard
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:
No such attachment on this page
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:
No such attachment on this page
(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:
Copy to clipboard
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

History

Information Version
Wed 23 of Dec, 2020 15:29 GMT-0000 paroj 13
Mon 14 of Dec, 2020 02:56 GMT-0000 paroj 12
Thu 26 of Mar, 2015 20:19 GMT-0000 Jayray 11
Fri 26 of Oct, 2012 09:45 GMT-0000 Mind Calamity Added a bugfix to reduce triangle count by Wladimir Lukutin. 10
Wed 26 of Sep, 2012 10:09 GMT-0000 Mind Calamity 9
Tue 31 of Jul, 2012 03:58 GMT-0000 Mind Calamity Added table of contents and updated code to work with the latest OGRE versions. 8
Tue 31 of Jul, 2012 03:51 GMT-0000 Mind Calamity 7
Sat 03 of Mar, 2012 19:01 GMT-0000 Diamond145 Never throw exceptions in ctor's 6
Tue 29 of Mar, 2011 09:24 GMT-0000 jacmoe 5
Sat 02 of Jan, 2010 04:22 GMT-0000 jacmoe 4
Thu 24 of Dec, 2009 17:10 GMT-0000 jacmoe 3
Thu 24 of Dec, 2009 17:10 GMT-0000 jacmoe 2
Tue 17 of Nov, 2009 17:26 GMT-0000 Spacegaier 1