Reading text back from a DirectLabel

My Google Fu is usually good enough to solve this for me, but I’ve searched the forums and the manual / API reference, and I can’t find it.

How can I read the text off a DirectLabel?

I’m trying to get four labels to shift text through labels rather than in a block.

	self.HUDChatConsoleOutput03['text'] = self.HUDChatConsoleOutput02['text']
	self.HUDChatConsoleOutput02['text'] = self.HUDChatConsoleOutput01['text']
	self.HUDChatConsoleOutput01['text'] = self.HUDChatConsole['text']

No text gets moved, sadly. I was guessing a few other methods:

self.HUDChatConsoleOutput03['text'] = self.HUDChatConsoleOutput02.getText()

You cats are the best at this, so I’d love any help or pointers you can give me. How can I read back the text that’s been assigned to this label?

The label[‘text’] value is actually an OnscreenText object, and there is an OnscreenText method getText(), so you can use label[‘text’].getText().

But it might be better to store the list of texts you want to rotate through in a separate list, so you don’t have to pull them off the DirectLabel again.


I see your point about the list. I’ll go that route, although I’m struggling to understand how to pass that list object around without making it a global variable. Fun stuff!