How do you make Gui Lists with images and text
by DALO · in Game Design and Creative Issues · 09/06/2008 (3:49 pm) · 6 replies
Hello,
For the past few hours I've been trying all sorts of methods to try and get a dynamic list that is composed of images and text as one lline or block, whatever you'd like to call it. Eventually this list could be very long and will need to use the GuiScrollCtrl. Does anyone know how to do this?
Is it possible to create a gui control with all the bits and pieces inside of it and then push that control onto the scroll list? Any Ideas?
For the past few hours I've been trying all sorts of methods to try and get a dynamic list that is composed of images and text as one lline or block, whatever you'd like to call it. Eventually this list could be very long and will need to use the GuiScrollCtrl. Does anyone know how to do this?
Is it possible to create a gui control with all the bits and pieces inside of it and then push that control onto the scroll list? Any Ideas?
#2
What about warnings? Anything that says something like "Missing file" or "unknown ___".
Have you tried debugging the function yet to see if anything pops up as invalid, like the %guiID?
09/16/2008 (12:20 pm)
No errors?What about warnings? Anything that says something like "Missing file" or "unknown ___".
Have you tried debugging the function yet to see if anything pops up as invalid, like the %guiID?
#3
09/16/2008 (12:21 pm)
The other issue is that I don't know if you can push or add certain GUIs on others. Got anymore details?
#4
Are there any other methods that will allow you to keep a dynamic list of Gui Controls?
Thx for the help.
09/16/2008 (12:36 pm)
Yeah, before I had a pile of gui's and text packed into the GuiControl, so I just tried a simple GuiControl that has one bitmap ctrl to show an image. Still nothing, I echoed the id of the new control to the screen just to make sure that it's actually creating the control and it seems to working fine. If I push the newly created Control using the Canvas.pushDialog(%id), it does push the new control onto the screen. So it seems that the control does work, it's now just a matter of if GuiScrollCtrl supports a list of GuiContrls?Are there any other methods that will allow you to keep a dynamic list of Gui Controls?
Thx for the help.
#5
Thx.
09/16/2008 (12:43 pm)
I just figured it out......kinda. Canvas.repaint(); seemed to fix it. The only problem now is that it doesn't actually build a proper list, it puts each control on top of each other. I was kinda hoping that the scroll gui would automatically place the controls under each other........I guess I'll have to do that manually. But at least it showed up. woot woot.Thx.
#6
09/16/2008 (1:00 pm)
Sounds like you are on the right track. The one thing I do know is that GuiScrollCtrl is for text only. Keep that in mind.
Torque 3D Owner DALO
function buttonThatPushesGuis(){ %temp = addGui(); // list is the name of the GuiScrollCtrl list.addGuiControl(%temp); } function addGui(){ %guiId = new GuiControl() { canSaveDynamicFields = "0"; Profile = "GuiDefaultProfile"; HorizSizing = "right"; VertSizing = "bottom"; position = "0 0"; Extent = "1024 768"; MinExtent = "8 2"; canSave = "1"; Visible = "1"; hovertime = "1000"; new GuiBitmapCtrl(thumb) { canSaveDynamicFields = "0"; Profile = "GuiDefaultProfile"; HorizSizing = "right"; VertSizing = "bottom"; position = "0 0"; Extent = "84 79"; MinExtent = "8 2"; canSave = "1"; Visible = "1"; hovertime = "1000"; bitmap = some image.....; wrap = "0"; rotRadians = "0"; rotCenter = "0.5 0.5"; rotCenterNormalized = "1"; }; new GuiTextCtrl(someTxt) { canSaveDynamicFields = "0"; Profile = "Some Font"; HorizSizing = "right"; VertSizing = "bottom"; position = "100 0"; Extent = "198 42"; MinExtent = "8 2"; canSave = "1"; Visible = "1"; hovertime = "1000"; text = "Some Text Here"; maxLength = "1024"; startFadein = "0"; fadeinDone = "0"; fadeInTime = "1000"; startFadeout = "0"; fadeoutDone = "0"; fadeOutTime = "1000"; fadeCtrl = "0"; }; return %guiId; }This is essentially what I'd like to achieve but cannot get it to work. I don't get any errors but nothing shows up either. Am I missing something? Any help would be greatly appreciated.
Thx.