DirectGUI: textMayChange [SOLVED]

Hey guys, been a while since I posted anything here. I’m still working on my game, though.

I’ve got a question about the textMayChange option for DirectGUI components. Basically, I want to know when to set it to 1 and when to leave it at 0. For example, I have some DirectLabels that I’m using as menu items, and I don’t plan on changing the string that I’m using for their text, but I do plan on changing their font from time to time. Should I use 1 or 0 for textMayChange?

Also, what does textMayChange default to?

In this case, you should pass True. You should only pass False if you don’t plan on changing any of the text or its properties.

Passing False means to call TextNode.generate() to get the visible geometry for the text; this returns a GeomNode, which cannot (easily) be modified later. Passing True means to use the TextNode to render the text directly; this can be modified later.

A long time ago, this was an important optimization, because TextNodes were fairly expensive. But that is no longer true; TextNodes are no longer much more expensive than GeomNodes, so the attentive use of text_mayChange is not really very important any more.

The default value is True. You can safely omit this parameter and let it always default to True.

David

Great, thanks for the very informative reply.