So I have a plugin that listens to a specific custom keystroke, once the key is triggered it shows some PIXI text on the screen.
For the PIXI text to be shown it needs to be added as a child to the SceneManager.
Now as long as the PIXI text is a child of the SceneManager it will be shown on the screen.
I would like for the text to go away after a while. I can do this with either of two ways (it doesn't matter to me which of the two).
I tried to use the wait function of the GameInterpreter but it had no effect.
So to cut a long story short:
Is there a Best Practice way to wait for a couple of seconds before a specific function is called in my plugin?
For the PIXI text to be shown it needs to be added as a child to the SceneManager.
Now as long as the PIXI text is a child of the SceneManager it will be shown on the screen.
I would like for the text to go away after a while. I can do this with either of two ways (it doesn't matter to me which of the two).
- Remove the child from the SceneManager after a couple of seconds.
- Change the Text content to be empty (probably more efficient since I can re-write to this text again?) after a couple of seconds.
I tried to use the wait function of the GameInterpreter but it had no effect.
So to cut a long story short:
Is there a Best Practice way to wait for a couple of seconds before a specific function is called in my plugin?