Page 1 of 1

OgreTextAreaOverlayElement alignment

Posted: Mon Jan 21, 2019 5:19 pm
by Owl53
Ogre Version: 1.11
Operating System: Windows 10
Render System: OpenGL

Hi,

I have a TextAreaOverlayElement which, when created, is offset to one side. I wanted the text to be centred at the position I specified for it. Upon looking at the member functions for this class, I found the alignment functions. I tried the following function:

Code: Select all

textElement->setAlignment(textElement->Center);
This successfully aligned the text to the centre horizontally, but vertically the text did not move. After trying this, I instead tried using the following functions:

Code: Select all

textElement->setHorizontalAlignment(Ogre::GuiHorizontalAlignment::GHA_CENTER);
textElement->setVerticalAlignment(Ogre::GuiVerticalAlignment::GVA_CENTER);	
Neither of these functions seem to have any effect: the text remains where it was before.

Could anyone clarify what I'm doing wrong? The setAlignment function only seems to center horizontally, and the horizontal and vertical functions don't seem to have any effect full stop.

Thanks in advance.