After last weeks complete outage of internet access it’s nice to get back into development.
After the last session where I moved the screen fading routines from a dedicated object to the camera object (which makes more sense) I got thinking. Perhaps some of the other GUI elements should also be moved into the camera object.
So, this week I have been moving the quick dialogue routines from their own object into the camera. This was a little more tricky than I originally expected as the process for adding multiple pieces of dialogue onto the screen with the old method was to just create a new instance of the message object. However, as there can be only one camera I had to make some big alterations. Firstly I would need to create a series of data lists (like arrays but more flexible) to store each piece of dialogue, its position and its drawing state (opacity, etc).
There was one small gotcha during the process. As the camera is one of the first objects to be created for the game when it came to reading the view size (set at the point of creation) I discovered the variable was being set too early and was being set to a full screen mode size – as I test the game windowed this meant the messages were off the screen. After a bit of debugging I realised this was happening and added in a check to reset the view port size variable for the GUI drawing.
I have a little bit of tweaking to do but everything is working properly again.