Game Development Community

Word-wrap in GuiMLTextCtrl?

by Jay Barnson · in Torque Game Engine · 11/17/2005 (11:46 pm) · 6 replies

Is there any way to automatically word-wrap a string in GuiMLTextCtrl?

It looks like there's a stub, and I found a function in Font called WrapString (can't find if it's actually CALLED anywhere), but nothing I can actually call from within TorqueScript.

Lacking anything pre-existing, does anyone know of a nice resource available for doing this?

About the author

Jay has been a mainstream and indie game developer for a... uh, long time. His professional start came in 1994 developing titles for the then-unknown and upcoming Sony Playstation. He runs Rampant Games and blogs at Tales of the Rampant Coyote.


#1
11/18/2005 (3:21 am)
GuiMLTextCtrl already does wordwrapping on its own. What are you trying to do?
#2
11/18/2005 (11:45 am)
Hmmm.... didn't work for me.

I tried using setText() with a string that was too long for the control, as well as using setText followed by addText(%data, 1).

It's still getting clipped on the side, not wrapped.
#3
11/18/2005 (11:56 am)
Just an idea, but maybe your control is wider than it appears. Check its extent and see if it's drastically wider than it should be.
#4
11/18/2005 (1:38 pm)
It's a grandchild of a GUIScrollCtrl and the direct child of a GuiChunkedBitmapCtrl (to provide a non-white background)- should that make a difference?
#5
11/18/2005 (2:08 pm)
It might. What does resizing the control do?
#6
11/18/2005 (11:57 pm)
AH, got it working, thanks for talking me through it.

I had the client (child) area set too large was all. Many thanks! That's what I get for coding on way too little sleep!