Object Animations & GUI problems

Started by static, Sun 06/07/2003 15:15:37

Previous topic - Next topic

static

I have just started working in AGS and I
don't know how to animate objects.
How do you animate them?

-----
I have some GUI problems also. (I forgot to ask these the first time, sorry)

1.) I made a new GUI that Popups when the mouse is in the top of the screen. But what if I want the GUI to popup at the bottom of the screen"

2.) In this new GUI is also the inventory. I want to make a Broken Sword-kind inventory with the popup inventory but when I make this the buttons don't work. When I turn off the popup feature everything works. ???

- I didn't now if I should post this into a new thread but it seems more... errr... nicer this way.

scotch

Usually all the animation is done with views, import the frames of your animation into the sprite manager and set them up in a new view as a sequence of frames.

When you want the object to animate make ags run a script, in the script use the commands

SetObjectView (int object, int view); // to set the object to the right view.
AnimateObject (int object, int loop, int speed, int repeat);  // to start it animating.

if the object is object 3 and the view you've made is view 6 and the sequence of frames is in loop 0 and you want the object frame to change every 3 game frames and you want the animation to loop that would be

SetObjectView (3, 6);
AnimateObject (3, 0, 3, 1);

static

Thanks, but I forgot to ask the GUI question ( I edited the post almost immediatley, but you guys are fast).

Wolfgang Abenteuer

I don't really know how you'd make a popup at the bottom of the screen.  Maybe you could try something using mouse.y, like

if (mouse.y >=300) {
GUIOn(1); //if that's the number of your GUI
}

and then have GUI #1 set to "Popup modal".  As far as the buttons working, are you trying to get them to work like the standard Sierra format, where the GUI pops up, you click on one of the buttons, and one of them will bring up an inventory window?  If that's the case, select your popup GUI, note the object number of the button that you want to use for your inventory screen, then go to the global script and where it says function interface_click (int interface, int button) {, enter a statement like this:

if (interface == 1) { //assuming we're still going with GUI #1 here
if (button == 1) { //the object number of the button you're assigning to bring up
//your inventory screen
InventoryScreen();
}
}

That's pretty much just a guess, though, since I've never tried anything like this. *shrugs*

~Wolfgang

static

No, no...

I made a new GUI that is the inventory and has buttons like
quit , inventory up and inventory down. Now, I made this gui
popup when you place your mouse at the top of the screen, but
then none of the buttons work.

Wolfgang Abenteuer

Oh, okay.  Make sure that you have the "Clickable" box selected for that GUI.  Also, be sure that each of the buttons have a script assigned to them.  Aside from that, it should work.  Maybe someone else can give you more information.

~Wolfgang

Scummbuddy

on the gui floating window that pops up when in the gui editor, there is a x position and y position entries that you can change to make them pop up in different positions.
- Oh great, I'm stuck in colonial times, tentacles are taking over the world, and now the toilets backing up.
- No, I mean it's really STUCK. Like adventure-game stuck.
-Hoagie from DOTT

SMF spam blocked by CleanTalk