Game Development Community

Frame selection from a multiple cell file

by Jack La Corte · in Torque Game Builder · 11/24/2006 (11:21 am) · 5 replies

I've got an options screen and want to create a control for selecting which tile back is shown on the screen for the face down tiles. All my tiles and tile backs are in a single celled file. I can't seem to find the proper control for displaying the tile backs on my options screen.

I ended up using a GuiScrollControl and GuiDynamicCtrlArrayControl in the gui interface, and then from inside my scripting I have a FOR loop to build a new GuiBitmapButtonCtrl for each tile back. The buttons work and I can change the tile backs using this method, but the tile backs in the GuiScrollControl have no graphics displayed.

I also tried various other controls, trying to display the frame in question. This is either going to be easier than what I've been trying or more difficult, I don't know. Has anyone found a way to do this or maybe some suggestions that I can try? I guess worst case scenario I could move each individual tile back into its own file and build the display dynamically from whatever files it finds in that particular folder. I did that for the background images but was hoping to use the tile backs from their current location in that celled file.

#1
12/03/2006 (2:05 pm)
I'm still relatively new, but I ran across the same problem recently. I could not find a resolution to it, and eventually took the few single cells I needed and made individual image maps out of them. :(
#2
12/09/2006 (7:20 am)
I did the same and it works, but I consider this to be sloppy when all the data is already there but we can't access it.
#3
02/22/2007 (1:54 pm)
There must be a better way to do this. Perhaps one of the devs could provide a little insight...
#4
02/23/2007 (9:42 am)
Not sure about in the GUI system, but if you could build the options as a level, you could call .setFrame() on a t2dStaticSprite object. I know you wanted to do it in the GUI sytem though. I'm curious myself if any work has been done to the GUI controls specifically for TGB.
#5
02/23/2007 (3:54 pm)
Merfy is on the right track. Place a t2DSceneWindow object in your GUI, and then use a t2DStaticSprite. See my article Using Sceneobjects with GUIs on TDN to see what I mean