Game Development Community

GuiTextCtrl word wrap and guiT2DObjectCtrl replacement

by Bojan Vukojevic · in Torque Game Builder · 04/03/2011 (10:02 am) · 3 replies

Hello guys,

I'm having some issues with guis hope you can help me. I have a gui with quite a few lines of text and I'm trying to display it with word wrap. I used GuiTextCtrl but cant find how to wrap the text. Also i used GuiMLTextCtrl and it works as i want it to do except when i click on the text i can select it and i would love to disable that. I looked all around the forums and TDN no luck so far.

Another thing that is bothering me is guiT2DObjectCtrl. I just want to put some image maps and animated sprites into my gui and guiT2DObjectCtrl should do just that. The problem is that i get an error "Unable to instantiate non-conobject class guiT2DObjectCtrl.". According to this post i need to include it and recompile tgb. As i do not have the source is there any other gui control that can help with this?

#1
04/09/2011 (3:07 pm)
yourTextObject.setActive(0); -- should take care of the "clicking on the text" issue with a GuiMLTextCtrl.

Can't speak to the other question really, as I try to stay as far away from the gui objects as possible... but isn't there a... guiBitmapCtrl? I seem to recall something like that. Not sure about animated?

Anyway I know the setActive thing will do wonders!
#2
04/10/2011 (1:39 pm)
Hey Tim thats just what i was looking for works perfect :)

Bitmap ctrl gets its image from the file and i would love to use image maps and i think i cant use it for animated things and thats what i need now. How do you solve things like this? I'm thinking about using objects and new scene graphs like some threads suggest but not sure if its worth the hassle for simple guis like i have now.
#3
04/11/2011 (5:21 pm)
Like many, we make all of our gui stuff out of normal t2d scene objects (staticsprite, animatedsprite, etc.)

We use behaviors (GenericButtonBehavior... things like that) and just build the whole gui system out of those. It's not super elegant and requires way more script and way less TGB Editor, but it's the only way to really get away from that horrid mess.

A proper programmer I guess could just dig in and ADD/FIX whatever they wanted into the gui system, but our needs were simple so we skipped that.