GUI Animation Module

Started by Cogliostro, Fri 01/02/2013 01:48:54

Previous topic - Next topic

Cogliostro

Okay, figured it was time to start building GUI's from scratch.  Just want a icon in the upper left that ANIMATES, and when you click on it, a separate inventory screen slides into view.  Most of this has NOT been a problem.  I only run into an issue when I try to animate it.

Here's the code:

function room_AfterFadeIn()
{
  //Start the GUI SPINNING!
  gGui1.Visible=true;
  gGui1.LockView(32);
  gGui1.Animate(0, 1, eRepeat, eNoBlock);
}

It shows up, but never animated.  So, what am I doing wrong AND where should I put it if I want the GUI to animate in every room without having to setup the code in the room_AfterFadeIn()?

VERSIONS:
AGS Editor .NET (Build 3.2.1.111) / v3.2.1, March 2011
GUIAnimation_VERSION 2.0

- Cogliostro

"First things first, but not necessarily in that order." - Dr. Who

MurrayL

I've never used the GUIAnimation module, so I couldn't say why the animation isn't playing (I just looked through the manual and it seems you're doing everything correctly, as long as there is more than one frame in view 32, loop 0).

To have it run before fade-in on every room, you can use the following code in your global script:
Code: AGS

on_event(EventType event, int data){
    if(event==eEventEnterRoomBeforeFadein){
        // Your code goes here
    }
}

Cogliostro


Thanks!  Even if I never get the animation to work, that bit of code will definitely come in handy.

- Cogliostro
"First things first, but not necessarily in that order." - Dr. Who

geork

I know this solves the initial issue as well as the NRA solves gun crime (satire! :D) but just for this instance, instead of using the GUI animation module, you could stick a button on the GUI and animate that (and see if it works). I know it's less elegant, but unfortunately I've never used the module either... Remember though that buttons have different parameters, namely:  Button.Animate(int view, int loop, int delay, RepeatStyle).

Hope that helps!

Cogliostro

#4
Well, the module never worked, but between the two comments I do believe I have the GUI that I was after!

Thanks to both of you,
- Cogliostro
"First things first, but not necessarily in that order." - Dr. Who

SMF spam blocked by CleanTalk