Adventure Game Studio

AGS Support => Beginners' Technical Questions => Topic started by: Salzi on Fri 22/03/2019 13:11:45

Title: Objects, GUIs and workarounds
Post by: Salzi on Fri 22/03/2019 13:11:45
Hey guys,

right now I'm trying to figure out something that might have a real quick and easy solution for it, so you guys can surely help me.
My game has a notebook GUI (see picture below) that is accessible always via the book icon in the upper left hand corner of the screen.
It has a bunch of stuff in it, and multiple connecting GUIs as pages. At the corners of the book there are invisible buttons to flip the pages.

(https://i.imgur.com/23SUXAA.jpg)

Now, I want to add a page where the player has to solve a puzzle inside the notebook, with a kind of - for lack of a better word - shifting and animating select mechanism.
Click on the arrow, it animates the shift and comes to a halt at the next word. It's supposed to look like this in the end:

(https://i.imgur.com/8rZK8Bo.jpg)

As you appearently can't animate things in GUIs, I had to find a work around.
I planned on making the notebook page that is needed an object instead, so closing the GUI and making the object visible when you flip the last GUI-page.
The next step would be to make a transparent GUI with buttons that make the arrows work and put it on top of the object.

The problems I've run into:
Code (ags) Select
function Button214_OnClick(GUIControl *control, MouseButton button)
{
  AufgabenBuch.Visible = true;
}
Title: Re: Objects, GUIs and workarounds
Post by: Cassiebsg on Fri 22/03/2019 14:13:04
But you can animate stuff in GUIs!
Just use a button and then you can animate it.  ;) Note that the fact that it's a button doesn't mean you need to make the button be clickable and do something.

And to answer your question, to animate room objects in Global you can't address it by name (as far as I know) you need to do object[0].Visible=true; // or whatever the ID number to that object is.
But as I said, you can animate buttons in GUIs, so that would be an easier solution IMHO.  ;)

EDIT:
Code (ags) Select

button.Animate(int view, int loop, int delay, RepeateStyle) ;


Hope it helps.  (nod)