Adventure Game Studio

AGS Support => Beginners' Technical Questions => Topic started by: ndekaise on Mon 14/09/2020 10:08:52

Title: [SOLVED] DisplayAt() : How to hide the text window after x seconds ?
Post by: ndekaise on Mon 14/09/2020 10:08:52
Hi Everyone,

I use displayAt() to display some text at a specific position, but the player need to click to hide the window and resume the game.
I wanted it to disappear automaticaly after 1 second.
Is anyone know a way to do that ?

Thanks in advance :)
Title: Re: DisplayAt() : How to hide the text window after x seconds ?
Post by: Olleh19 on Mon 14/09/2020 10:17:43
Go into your gui's in the interface and click the elipse button and choose "on click", in there type

gGui.Visible = false;

Change gGui to the name of the window you have.
Title: Re: DisplayAt() : How to hide the text window after x seconds ?
Post by: ndekaise on Mon 14/09/2020 10:49:07
Hi Olleh19 !

Thanks for your answer, but when I use this :
Code (ags) Select
DisplayAt(150, 150, 200,  "SPLASH!");
it display a standard text window and I don't think I have a pointer or variable to access it.
Title: Re: DisplayAt() : How to hide the text window after x seconds ?
Post by: ndekaise on Mon 14/09/2020 10:54:54
Quote from: Olleh19 on Mon 14/09/2020 10:17:43
Go into your gui's in the interface and click the elipse button and choose "on click", in there type

And I think you didn't understand exactly my original question, I don't need to hide a GUI on a mouse click.
I need to hide a standard message window (displayed by the "DisplayAt()" function) after x seconds, and not wait for the user to click. :)
Title: Re: DisplayAt() : How to hide the text window after x seconds ?
Post by: Olleh19 on Mon 14/09/2020 11:09:05
Quote from: ndekaise on Mon 14/09/2020 10:54:54
Quote from: Olleh19 on Mon 14/09/2020 10:17:43
Go into your gui's in the interface and click the elipse button and choose "on click", in there type

And I think you didn't understand exactly my original question, I don't need to hide a GUI on a mouse click.
I need to hide a standard message window (displayed by the "DisplayAt()" function) after x seconds, and not wait for the user to click. :)

No, wait there is a function where you should be able to set the length for how long a message is showed on screen.

Edit: Found it. Game.MinimumTextDisplayTimeMs = write whataver numbers;

Edit again: Maybe you could just try Wait(3);

???

Title: Re: DisplayAt() : How to hide the text window after x seconds ?
Post by: Khris on Mon 14/09/2020 12:14:13
If you want this to look exactly like the Textwindow GUI used by DisplayAt, you have to create your own GUI, then use something like WaitMouseKey(GetGameSpeed());  in between turning the GUI on and off.

If you just want to display text, you can use  Overlay.CreateTextual(...)  instead.
Title: Re: DisplayAt() : How to hide the text window after x seconds ?
Post by: Slasher on Mon 14/09/2020 12:17:55
One way...Try changing text reading speed.

Default is 15... try this and return afer it's gone.

Code (ags) Select

//  Just before display is shown
Game.TextReadingSpeed=30; // text goes away faster..
// Then after display is shown slow it back down..
Game.TextReadingSpeed=15;
Title: Re: DisplayAt() : How to hide the text window after x seconds ?
Post by: ndekaise on Fri 18/09/2020 08:51:20
Quote from: Khris on Mon 14/09/2020 12:14:13
If you want this to look exactly like the Textwindow GUI used by DisplayAt, you have to create your own GUI, then use something like WaitMouseKey(GetGameSpeed());  in between turning the GUI on and off.

If you just want to display text, you can use  Overlay.CreateTextual(...)  instead.

Juste perfectly what I needed ! thanks !

Quote from: Slasher on Mon 14/09/2020 12:14:13
One way...Try changing text reading speed.

Default is 15... try this and return afer it's gone.

I'll try it too, but for another purpose thanks ! :)