Animating a GUI?

Started by ezra, Sun 29/02/2004 01:17:08

Previous topic - Next topic

ezra

hello everyone, I am new to AGS and this is probably a stupid question, but how do you animate a GUI (like in the game Apprentice). I want to be able to put my mouse in a certain position (bottom of screen) and then my custom GUI will SLIDE up and when my mouse moves away it will SLIDE down.

thanx heaps
He who laughs last thinks slowest.

Ben

#1
First, place your GUI so it's y value is at the bottom of the screen (either 200 or 240). Then at the beginning of the global script, add this:

int gui_ypos = 1;

And in the repeatedly_execute section of the GLOBAL script, add this:

if((mouse.y > 194) && (gui_ypos > 0)){
 SetGUIPosition(GUI#,0, gui_ypos - 240); //where GUI# is the name or number of the GUI you're moving
 gui_ypos ++;
}

That should make the gui move up when the mouse is near the bottom of the screen. I may have misses something, so be sure to test it ;)

SMF spam blocked by CleanTalk