Author Topic: GUI Scroll Control & Variable  (Read 1278 times)

Hello, I have a couple of problem I am attempting to find, they all include GUIs.

I am realy new to GUI makeing, and I am making a personal RPG mod.

-----------------------------------------------------------
  • How do you use Scroll Control?
-----------------------------------------------------------
  • How do you make it so when you press a button, the window gives different Text.
-----------------------------------------------------------
  • How do you make it so you can give the number on a Variable.
    Eg.
    If egg = 1, (text) Egg: 1
    If egg = 2, (text) Egg: 2  
-----------------------------------------------------------
  • How do you make it so an image and text only appear if you have a Variable greater than 0.
-----------------------------------------------------------

-----------------------------------------------------------
  • How do you use Scroll Control?
-----------------------------------------------------------
Look HERE
-----------------------------------------------------------
  • How do you make it so when you press a button, the window gives different Text.
-----------------------------------------------------------
In the function called by the button put the following code
Code: [Select]
CONTROL_NAME.setText("TEXT_HERE");
-----------------------------------------------------------
  • How do you make it so you can give the number on a Variable.
    Eg.
    If egg = 1, (text) Egg: 1
    If egg = 2, (text) Egg: 2  
-----------------------------------------------------------
You could do something like
Code: [Select]
function GUINAME::onWake(%client)
{
if(%client.Egg == 1)
{
CONTROL_NAME.setText("Egg: 1");
}

else if(%client.Egg == 2)
{
CONTROL_NAME.setText("Egg: 2");
}
}
Or you could do something like this
Code: [Select]
function GUINAME::onWake(%client)
{
CONTROL_NAME.setText("Egg: " @ %client.Egg);
}

Thank you.

I think I can figure it out now.

My main problem is this parenting crap. No tutorial tells you how to parent it to somthing other than just right click.
« Last Edit: December 29, 2011, 10:21:45 AM by Aware »

My main problem is this parenting crap. No tutorial tells you how to parent it to somthing other than just right click.
Right click a control in the menu and add a new control, that control you right clicked is now the parent of the new control you made.

The reason for parenting is for example if you parent something to a window and you move the window then all the window's children will move too. there are also other uses for parenting.

Oh I scanned you tutorial just now and found it.

My main problem is this parenting crap.
If you ever decide to edit the code itself in a text file, to parent you just put one control inside another's {}s.

If you ever decide to edit the code itself in a text file, to parent you just put one control inside another's {}s.
Right click a control in the menu and add a new control, that control you right clicked is now the parent of the new control you made.

The reason for parenting is for example if you parent something to a window and you move the window then all the window's children will move too. there are also other uses for parenting.

And yes I know you can do that. I just was annoyed with having to quit and restart.

And yes I know you can do that. I just was annoyed with having to quit and restart.
I'm not sure if you were responding to my comment with jes00's or if you didn't understand what I said or what, because neither of those possible responses make any sense. jes00's is talking about the ingame gui editor and mine wasn't suggesting you do that in place of it.