GuiMLText tags
by Michael Lattanzia · in Torque Game Engine · 08/24/2007 (11:57 am) · 8 replies
I'm looking for some information on the tags that can be used with the torque Markup Language. The best information I can find is here: http://tdn.garagegames.com/wiki/GUI/Profiles/ControlList#GuiMLTextCtrl however this is missing some important info. The big thing I need to know is what does do? I'd like to use the MLText for printing a list of bitmaps that can be scrolled through, but I need some information from them as well, and possibly to update individual pieces of the MLText box.
#2
just put the GuiMLTextCtrl in a GuiScrollCtrl.
> I need some information from them as well, and possibly to update individual pieces of the MLText box.
not sure what you mean here.
08/24/2007 (2:54 pm)
> I'd like to use the MLText for printing a list of bitmaps that can be scrolled throughjust put the GuiMLTextCtrl in a GuiScrollCtrl.
> I need some information from them as well, and possibly to update individual pieces of the MLText box.
not sure what you mean here.
#3
The idea is that I have a list of skills, that may change, so I'd like a scrollable list containing bitmaps (using the file data stored in the skill datablocks) that is created at runtime. In addition to displaying the bitmap I'd like to display the actual skill value as well, which is simple, and then two buttons for incrementing and decrementing that skill value. This last part is one thing I haven't figured out yet. I need a way to create buttons that line up (and scroll) with each skill.
The other thing is that I would like to have 3-4 classifications of skills (untrained, trained, specialized for example) with a separate list for each (or maybe just 3 sections in one list). I was thinking perhaps another button or two so the player can move that skill from untrained to trained to specialized (and back down if they change their mind). This means basically moving the entire line (including the bitmap associated with the skill, the value, and the buttons) to either another list completely or another section of the same list. I haven't had a chance to look because I've been at work, but I was thinking if I could use to label each section then I might be able to find a function that would allow me to remove a line from anywhere in the list and another function to add a line somewhere else (I actually already know there is a .addText() function that I can use for that).
Any help with this would be appreciated. I'm fairly new to the gui stuff, but I'm picking it up pretty quick I think.
08/24/2007 (3:12 pm)
I currently have a GuiMLTextCtrl inside a GuiScrollCtrl. This does exactly what I want it to do. However, I have a few things that I'm still trying to figure out, so let me explain exactly what I want.The idea is that I have a list of skills, that may change, so I'd like a scrollable list containing bitmaps (using the file data stored in the skill datablocks) that is created at runtime. In addition to displaying the bitmap I'd like to display the actual skill value as well, which is simple, and then two buttons for incrementing and decrementing that skill value. This last part is one thing I haven't figured out yet. I need a way to create buttons that line up (and scroll) with each skill.
The other thing is that I would like to have 3-4 classifications of skills (untrained, trained, specialized for example) with a separate list for each (or maybe just 3 sections in one list). I was thinking perhaps another button or two so the player can move that skill from untrained to trained to specialized (and back down if they change their mind). This means basically moving the entire line (including the bitmap associated with the skill, the value, and the buttons) to either another list completely or another section of the same list. I haven't had a chance to look because I've been at work, but I was thinking if I could use
Any help with this would be appreciated. I'm fairly new to the gui stuff, but I'm picking it up pretty quick I think.
#4
gamelink might be your thing.
plus
(image of a button)
> I need a way to create buttons that line up
if you can live with having the bitmap & description on the left and the buttons on the right,
_and_ the buttons are the same width for each item, you can put the buttons on the right by and they will line up.
you might also be interested in the GuiArray2Ctrl resource by, hem hem, me.
08/24/2007 (3:21 pm)
> two buttons for incrementing and decrementing that skill valuegamelink might be your thing.
> I need a way to create buttons that line up
if you can live with having the bitmap & description on the left and the buttons on the right,
_and_ the buttons are the same width for each item, you can put the buttons on the right by
you might also be interested in the GuiArray2Ctrl resource by, hem hem, me.
#5
08/24/2007 (3:29 pm)
Hmmm, how does gamelink work exactly? That's probably what I'm looking for, but I've had trouble finding any info on the Markup language outside of the link I posted above (which doesn't have info on the gamelink stuff).
#6
The next question would be how to find individual lines and remove them. There is no remove text functions, so it looks like I'll have to find a way to re-write the text by traversing it and then leaving out the part I want to remove. Any other suggestions there?
08/24/2007 (3:44 pm)
Okay, I figured it out from here: www.garagegames.com/mg/forums/result.thread.php?qt=25596The next question would be how to find individual lines and remove them. There is no remove text functions, so it looks like I'll have to find a way to re-write the text by traversing it and then leaving out the part I want to remove. Any other suggestions there?
#7
just make a normal links like:
(button)
(button)
and then write a handler for the GuiMLControl:
08/24/2007 (3:47 pm)
Actually i don't know what gamelink does, and i don't think you need.just make a normal links like:
and then write a handler for the GuiMLControl:
function myGuiMLTextCtrl::onUrl(%this, %url)
{
%first = getWord (%url, 0);
%rest = getWords(%url, 1, 10000);
switch$ (%first) {
case "move":
if (%rest $= "up")
// move it up
else
// move it down
default:
// error
}
#8
yeah, traversing and rewriting, or storing it in another form and rewriting.
08/24/2007 (3:49 pm)
Heh. as far as removing lines, yr sort of on yr own with that one.yeah, traversing and rewriting, or storing it in another form and rewriting.
Torque 3D Owner Jacob