GUI Question

Started by Armageddon, Mon 20/06/2011 03:12:40

Previous topic - Next topic

Armageddon

Hello. I've made a simple GUI for my game set it all up and it works fine.



As you may be able to see it's a film strip. I really wanted it so that when you walk it overlays other images over this, just while you walk, so it looks like it's moving. I've already imported them. I'm thinking I somehow enable and disable a timer while he's walking or something?

Khris

I would use a second, non-clickable GUI with a higher z-Order that's transparent except for two buttons at the top and bottom.
Those buttons animate continously, displaying the images of the moving holes.

All that's left to do is turn the GUI visible during animations or just walking.

Code: ags
void repeatedly_execute_always() {
  if ((!IsInterfaceEnabled() || player.Moving) && !gHoles.Visible) gHoles.Visible = true;
  if (IsInterfaceEnabled() && !player.Moving && gHoles.Visible) gHoles.Visible = false;
}

Armageddon

Awesome I'll give it a try. Thanks.

Armageddon

So I'm having a small problem, my GUI image takes over the entire screen, and I've set up all the buttons and things. The problem is that the player can't walk or anything , I thought that you could click through transparent images. I only wanted it to react to the buttons. ???

Khris

Yeah, the GUI has to be clickable and thus will catch mouse clicks regardless of the background color. You have to split it up.

SMF spam blocked by CleanTalk