In this video Jesse Freeman teaches you how to add text to the message window and automatically close it after a slight delay. This allows you to not only display a simple message but automatically hide it for the player without making them interact with it directly. You’ll want to keep this pop up message on the screen just long enough for the player to read it then remove it when they are done.
- View Offline
- Exercise Files
- [Voiceover] Now that our message window is able…to open and display text,…it's time for us to add the logic…that will automatically close it…after a given amount of time.…Let's go back into our message window class.…At the top of our class,…let's add a new public field, typed to a float,…and we'll call this closeDelay.…We'll set this to 2f…so that it runs after two seconds.…Next, we're gonna set up a private float…for the delay that we'll use internally…to track how much time has happened…since the window was opened.…
And we'll use another private bool…in order to track whether the window is closing or not.…Now after our Awake method,…let's override the Open method.…Once the window opens,…we want to set the closing flag to true.…We also want to reset the delay…to equal zero.…We do this because if you open the window multiple times,…we want it to reset itself correctly.…Let's go ahead and add back in our update method.…
We'll make this private, void Update.…And inside of it, we're gonna keep track of the delay.…First, we want to make sure…
- Preparing the user interface
- Creating game and message windows
- Building a battle window
- Adding a monster and action buttons
- Creating an actor class
- Adding player and monster attack actions
- Triggering battles from the map
- Ending a battle
- Cleaning up the battle and attack systems
- Rewarding the player
Skill Level Intermediate
1. Preparing the UI
2. Message Window
3. The Battle Window
4. Actor Classes
5. Battle Actions
6. Cleaning Up Combat
- Mark as unwatched
- Mark all as unwatched
Are you sure you want to mark all the videos in this course as unwatched?
This will not affect your course history, your reports, or your certificates of completion for this course.Cancel
Take notes with your new membership!
Type in the entry box, then click Enter to save your note.
1:30Press on any video thumbnail to jump immediately to the timecode shown.
Notes are saved with you account but can also be exported as plain text, MS Word, PDF, Google Doc, or Evernote.