You get a textbox, and you get a textbox, and you get a textbox!
Welcome back! This is the third consecutive post about creating the dialogue system for this game. Two posts ago covered getting to the point where if we press the action button in front of something that we can examine, a textbox with text about that item will pop up. Last post covered a deep dive into setting up a Signal Bus, which is now serving as a notification hub for our entire game.
In the time between last post and this one, my focus was on making the textboxes better. Here’s what the textbox looked like when we last left off:
We had reserved some room for a portrait on the far left of the textbox (where the sprite of Rob is standing - this is just a placeholder for an actual portrait of the speaker). Then, to the right, we printed our line of text.
One thing I spent time thinking about during this span was what different types of textbox interactions are there?
For example, when we examine the old video game console on the ground, we don’t actually need a portrait. Rob is the character who checked it, but it doesn’t really make sense to have a portrait of him next to the description just because he checked it. I started referring to this use case as ‘exams’ in my code. As in, you examined something - you’re not talking to someone.
An obvious second case is when you are talking to someone. Ideally, if two people are talking, you will be able to see the speaker’s name printed, as well as a portrait (which I’ll be making in pixel art) of the speaking character. But, not every minor character you can talk to in the game is going to have a portrait. Portraits are reserved for conversations with important characters. Because of this, talking to someone got split into two scenarios - talking to someone who has a portrait, and someone who doesn’t.
Building a system that could accommodate these three cases are what I spent the bulk of this update doing. Here are some pics of working textboxes for the three cases:
A lot about the above will change - for example, this isn’t the font I’m going to use. The textbox might not actually have a black and white design when finalized, etc. But, we’re covering a lot more functionality with our textboxes now than we were last update, which is progress I’m really happy with.
Have a great day!