5
\$\begingroup\$

I want to make a frames per second and debugging info overlay, similar to the one in the bottom of the following image, but without using SDKTrays or OIS.

enter image description here

I also want to be able customize its look, by changing its font and background color. How do I program something like this, in C++?

\$\endgroup\$
1
  • \$\begingroup\$ Please choose Ogre or mOgre. They're different bindings of the same engine. You can't choose C++ and C# at the same time. \$\endgroup\$ May 1, 2012 at 3:36

1 Answer 1

5
\$\begingroup\$

http://www.ogre3d.org/tikiwiki/Simple+Text+Output&structure=Cookbook

Simple as adding the 40 lines class file to your project loading a font of your choice and calling TextRenderer::getSingleton().printf("text", "Last FPS: %f", renderwindow->getLastFPS()); from your update method body.

Don't forget to initialize and remove the text overlay!

EDIT:

You can change it color on the initialization of the overlay: TextRenderer::getSingleton().addTextBox("text", "Last FPS:", 10, 10, 100, 20, Ogre::ColourValue(redValue, greenValue, blueValue, alphaValue);

And the font on the fontdef file.

Not sure about the background, but you can easily add another overlay behind the text modifying the addTextBox method.

\$\endgroup\$

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .