Page 1 of 1

How do I center static text?

Posted: Fri Jul 18, 2008 2:36 am
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?

Posted: Fri Jul 18, 2008 6:47 am
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.

Posted: Fri Jul 18, 2008 10:36 pm
by CameroKid
thanks