Drawer-style GUI

Started by kkmic, Tue 08/07/2008 12:18:58

Previous topic - Next topic

kkmic

Not sure if this topic belongs here, but since I m a beginner here it goes:

(please move it to the appropriate section if I posted it in the wrong place)

As the title said, I am interested in making a drawer style GUI. Something similar with the one found in the "Modern" skin from the current version of Winamp. I needed it for my main menu. In other words, I have a button on the main menu that, when pressed, will cause the new GUI to slide into view from below the one already visible.

I am not interested in making it modal, as I need access to both GUIs there. I just want to add a bit of interactivity to my main menu.

How can i do that? As I found out in the FAQ, GUIs stack in the order of their creation in the editor, oldest at the bottom. My problem is that the new GUI (the one that needs to slide into view) is larger then the one already present (so I cannot stack them and just slide the new one in with a looping script).

As I figure it out (I am not home so I cannot test this) I have 2 options:
- resize the new GUI on the fly during the slide in process. Is this possible? Relative to which corner my GUI will resize? Top left?
- cover the unwanted visible part of the drawer with an object, or a black GUI with no controls since the background in that area is pure black. The drawer will be set not to register any clicks until is fully opened.

Both solutions seem viable, and I would prefer the second one.

Has anyone attempted this before? I could not find any related info on this topic. Please point me in the right direction if there is such info on the forums.
Anyone has any pointers regarding this idea?


Mazoliin

Sound like you need to change the Z value of the gui, so that the gui you want hidden has a lower Z than the one it should be behind.

Ishmael

Just make the top GUI larger, add some extra black space to it's background graphic if you have one, resize and position it appropriately to hide the GUI beneath completely. Clicks don't go through GUIs that are set to clickable, so the one underneath won't register clicks if it's behind a clickable GUI.
I used to make games but then I took an IRC in the knee.

<Calin> Ishmael looks awesome all the time
\( Ö)/ ¬(Ö ) | Ja minähän en keskellä kirkasta päivää lähden minnekään juoksentelemaan ilman housuja.

kkmic

Damn...

Excellent point with the "add some extra black to the top GUI to make it hide the bottom one". I am so thick sometimes. Thanks a lot Ishmael.

SMF spam blocked by CleanTalk