Game Development Community

Recycled GUI Components?

by Dreamer · in Torque Game Engine · 04/29/2005 (6:48 pm) · 1 replies

I'm just curious as to how one would go about recycling a gui component, for instance.
I have a GuiTextListControl, called InventoryList, I would like to use this InventoryList in more than one Gui, for instance the InventoryGUI as well as a PlayerTradeGUI where Players could swap items... Only problem is I can't really seem to wrap my mind around how to do it. If I just do what seems logical (create a new InventoryList in each GUI via the New Command), it appears that neither InventoryList will work.
Is there way to do this, without copying the information from one GUI to another? Why can't I get them to play nice and share?

#1
04/30/2005 (1:23 pm)
All objects have to have unique names. The usual solution is to prepend something, like "Trade_InventoryList and Inv_InventoryList". It won't be the same object but will let you access both. (Wouldn't namespaces be cool here? On the todo list, of course...)