Page 1 of 1

guiElement::TextArea - can't display with spaces in string

Posted: Mon Jan 24, 2005 5:35 pm
by Van
Ogre Version 0.15.2 on MSC++ 7.1;

I am having a problem getting an Overlay to display a string with spaces in it. From .overlay file (note the CAPTION parameter):

EXAMPLE 1: WILL NOT WORK
This will only display Sample.

Code: Select all

// MessageNotifcation (speed)
container TextArea(Hud/2D/MessageNotification)
{
	metrics_mode relative
	horz_align left
	vert_align top
	top 0.02
	left 0.02
	width 2
	height 0.15
	font_name TrebuchetMSBold
	char_height 0.020
	caption Sample Game Message Text
	colour 1 1 1
}
EXAMPLE 2: WILL WORK
This will display SampleGameMessageText.

Code: Select all

// MessageNotifcation (speed)
container TextArea(Hud/2D/MessageNotification)
{
	metrics_mode relative
	horz_align left
	vert_align top
	top 0.02
	left 0.02
	width 2
	height 0.15
	font_name TrebuchetMSBold
	char_height 0.020
	caption SampleGameMessageText
	colour 1 1 1
}
Even in my C++ code I can not set the caption to contain text with spaces..

Code: Select all

	Ogre::GuiElement* GuiHudTMessageNotification;
.......
	GuiHudTMessageNotification = GuiManager::getSingleton().getGuiElement("Hud/2D/MessageNotification");
......
	GuiHudThrottleText->setCaption("Update Game Message Text");
This will only display Update.

The Text containers (from the .overlay file) are not included in a BorderPanel. Do they need to be? What am I doing wrong?

Posted: Mon Jan 24, 2005 6:51 pm
by sinbad
Only happens if you use relative metrics, not sure why right now. Was raised before xmas but to be honest I forgot about it (we only use pixel metrics in our demos!). I'll look into it.

Posted: Wed Jan 26, 2005 12:43 am
by sinbad
I've fixed this in Hastur, it was due to an initialisation ordering problem which was only exposed by another patch in 0.15.1. It's already fixed in Azathoth because I rewrote that part a couple of days ago anyway for another reason.