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

Problems building or running the engine, queries about how to use features etc.
Van
Hobgoblin
Posts: 512
Joined: Fri Nov 19, 2004 3:56 am

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

Post 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?
User avatar
sinbad
OGRE Retired Team Member
OGRE Retired Team Member
Posts: 19269
Joined: Sun Oct 06, 2002 11:19 pm
Location: Guernsey, Channel Islands
x 67

Post 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.
User avatar
sinbad
OGRE Retired Team Member
OGRE Retired Team Member
Posts: 19269
Joined: Sun Oct 06, 2002 11:19 pm
Location: Guernsey, Channel Islands
x 67

Post 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.