On Sale: GamesAssetsToolsTabletopComics
Indie game storeFree gamesFun gamesHorror games
Game developmentAssetsComics
SalesBundles
Jobs
Tags

Day 5:

My next short-term goal is to create the text-screen UI that appears whenever the player starts dialogue, or when the player interacts with an object in the game world. After watching different Youtube videos on how to approach this, I settled on creating a custom C# class (here, Dialogue), that contains information for each text pop-up -> right now just the speaker, and the actual text that will be displayed. Then using Unity's UI system, I utilize a DialogueManager script that takes in a custom Dialogue class and uses the information from this class to populate my text onto the UI elements. To handle multiple panels of text, I hold text blocks of elements in a C# Queue that I can pop off sequentially (an array would probably work just as well, but a queue doesn't have to worry about indexing). And to have the text appear letter by letter, I used a coroutine that adds in one letter to the text panel for every frame. I actually read a recent Gamasutra blog on text reveals that points out this method's flaws and says that it is a naive approach (and suggests how to improve this), but for now it works and I have time later I can try to polish it up following the Gamasutra's article's suggestions.

My current dialogue/encounter pop-up system looks like this:

So right now there's an awkward white box in the upper right corner saying START DIALOGUE for me to reveal the text panel. Tomorrow I want to actually integrate this into the current player movement - that is, when the player is facing an interactable object and presses SPACE, the text panel will appear.