Walking behind a GUI? (splitting a GUI into 2)[SOLVED]

Started by GokuZ, Sat 17/12/2005 15:21:29

Previous topic - Next topic

GokuZ

I've been modifying the MI2 GUI(1:MAINGUI) so I can have a better backround Image, because I need to use the GUI to the left and the bottom of the screen It fills the whole area and my character wont walk around the screen because the GUI is covering my backround.
I think I need to create a seperate GUI for the Inventory and one for the command Buttons, but Im guessing this requires alot of script and I havent found a decent GUI Tutorial to learn to do it myself.
Can someone help me with this?

Death does not affect me : It's just a minor inconvenience

monkey0506

Just make one tall, skinny GUI (the height and width of the Inventory box) and one short, wide GUI (the height and width of the command buttons).  You might have to modify the script some if any of it depends on the GUI name instead of the GUIControl names, but it doesn't require scripting to make the new GUIs...

Ashen

Confound you, monkey_05_06, I spent ages typing this up, and you swoop in before I was done ... Pleh, I'll post anyway, it's more detailed:

Well, surely you've got all the command scripting you need? I mean, the buttons all work, right?

Just delete the Inventory buttons from that GUI, and put them on a seperate GUI (Looking at it, you'll probably need to set the background image of the new GUI as well). Then, resize the current GUI to just fit the command buttons, and reposition it so it appears in the same place.

To link the Inventory GUI controls to the script, depends on how it's set up. In 2.7+ coding, you'd just give them the same script names, and you'd be away (the control_Click functions already having been made). However, I think the MI2 template you're using still uses interface_click, right?

In which case, you'll need to open the global script at interface_click, and move the commands relating to the Inventory buttons out of the if (interface == MAINGUI){ condition and into one for if (interface == NEWINV){ (or whatever you call the Inventory GUI). You'll also need to change the numbers in the if (button == X) conditions, to whatever they are on the new GUI (e.g. the Scroll buttons might've been 9 and 10 on MAINGUI, but they'll be 0 and 1 on NEWINV).
I know what you're thinking ... Don't think that.

monkey0506

He didn't actually specify that he was using the 2.62- template, so I just as well assumed that he was using whatever sort of 2.7+ code that I've seen laying around here somewhere.  And yes...confound me...confound me to heck.

GokuZ

Thankyou for your detailed reply Ashen;
I will try making a new inventory GUI and leaving the orginal Command Buttons GUI as a flat skinnybar with the scroll buttons included. Ã, So yes technically I will need to alter the global script to anything that refers to the inventory itself (why doesnt that feel like its going to be simple) Ã, I will test it out and (inevitably) post any problems , Thnx

Im using the latest 2.7 MI template

Death does not affect me : It's just a minor inconvenience

Ashen

#5
QuoteHe didn't actually specify that he was using the 2.62- template
You're right, he didn't say so, I'm just assuming from the GiP thread. GokuZ: if I was wrong, feel free to completely ignore that post :P
However, the newest MI2 template I've got still uses interface_click, so it might still be of use.

In fact, I was just going to add another, simpler possiblity:

If you click somewhere on the transparent part of the GUI in the editor, you can set a command to run when you click n the GUI, but not on any controls. Set the script to on_mouse_click(button); and it should act as if it clicks through the GUI.
I know what you're thinking ... Don't think that.

GokuZ

SOLVED: It was actually much easier than either of you stated but it got me on the right track ,
I copied the Inventory Details from the maingui and then deleted the inventory box.
I created a new gui and added inventory box, and pasted in the details.
It works fine
Thankyou for your help xx

Death does not affect me : It's just a minor inconvenience

monkey0506

That's basically what I was trying to say in my first post.  Glad you got it working.

GokuZ


Death does not affect me : It's just a minor inconvenience

SMF spam blocked by CleanTalk