Game Development Community

Parenting GUI controls + lagging setContent()

by Backman · in Torque Game Builder · 09/04/2008 (2:22 pm) · 2 replies

Hiya all, I'm trying to parent a GUI object under another object and it just won't work. I don't have TGB here so can't remember exactly what to what but pretty sure it's the 'normal' GUI button trying to get parented to a bitmapCtrl.

I can drag the button under the right GUI control in the tree view, but moving the button in the viewport unparents it to the root again. I've done one of the tutorials which says to right click on the GUI control you want to (assumingly, doesn't actually say why) parent your new button to when dragging it out from the toolbar, but this doesn't seem to work well either.

A bit confused, is there items you can't parent to others? Or some work around I'm not familiar with?

I also get a slight lag when clicking between GUI's, and calling Canvas.setContent() to get between them. Is that normal? It's only a split second lag but you do notice it.

Thanks for any help!

#1
09/04/2008 (4:15 pm)
If you drag a ctrl around in the viewport it will automatically try to parent it to the control underneath where you drop it. If you want to move it but not have it do that, you could change its position field in the inspector, or you could select it and then use the arrow keys (shift + arrow for faster).

Yes there could be some lag when doing setContent, if its something you need faster you could combine your guis and use setVisible on different parts of it, or you can use a guiFadeinBitmapCtrl to hide it.
#2
09/11/2008 (4:06 am)
Thanks James, will try that.