How do I center static text?

If you are a new Irrlicht Engine user, and have a newbie-question, this is the forum for you. You may also post general programming questions here.
Post Reply
CameroKid
Posts: 71
Joined: Tue Jul 11, 2006 8:54 pm

How do I center static text?

Post by CameroKid »

Here's my command:

env->addStaticText( (const wchar_t *)catagorys[columns].c_str(), core::rect<s32>(
10 + ((screen.Width-20)/game.numberOfCatagorys)*(columns),
10,
((screen.Width-20)/game.numberOfCatagorys)*(columns+1),
70),
true, true, 0, 0, true);

I want to center the text in the rectangle I created in that GUI command. How do I do this.

Question on the side: why are the character types for irrlicht so screwed up? What happened to good old char or string? what is const wchar_t * anyway?
radical-dev
Posts: 45
Joined: Thu Apr 24, 2008 7:54 pm
Location: Wickede, Germany

Post by radical-dev »

Hi CameroKid!

Ever read the API ? ;-)

Use IGUIStaticText->setTextAlignment - EGUIA_CENTER should be your choice.

Answer on the side: The character types depend on the cross portability of the Irrlicht engine.
CameroKid
Posts: 71
Joined: Tue Jul 11, 2006 8:54 pm

Post by CameroKid »

thanks
Post Reply