[SOLVED] DisplayAt() : How to hide the text window after x seconds ?

Started by ndekaise, Mon 14/09/2020 10:08:52

Previous topic - Next topic

ndekaise

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 :)

Olleh19

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.

ndekaise

Hi Olleh19 !

Thanks for your answer, but when I use this :
Code: ags
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.

ndekaise

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. :)

Olleh19

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);

???


Khris

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.

Slasher

One way...Try changing text reading speed.

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

Code: ags

//  Just before display is shown
 Game.TextReadingSpeed=30; // text goes away faster..
// Then after display is shown slow it back down..
Game.TextReadingSpeed=15;

ndekaise

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 ! :)


SMF spam blocked by CleanTalk