OSD - On Screen Display

Sat 21 Apr 2018

Author: Lucas Fraser

As you may have heard from the latest video update, we've begin the framework of the on screen display system that we'll be using in-game for all the menus, and any 2D elements during game play such as the HUD, inventory and the likes. I chose to use the NanoVG library that LWJGL has kindly integrated itself with due to the simplicity of how it renders, this meant that we got to choose the system we wanted to draw things with rather than be confined to a particular style as is the case with most other OSD libraries. NanoVG basically just lets us draw shapes, text and images. We get to handle the rest of the system like managing the layout which makes it very flexible. Now, we could have implemented all the rendering ourselves, but why bother when someone else has already done the hard work for you. Its already optimised and working great with LWJGL so thats why we chose it. Basically we've created a list type layout, where we have a root node, and each node has children, this way we can anchor things in relation to their parent, and in-turn update the whole display easily when things like window events happen such as resizing. Below is a screenshot of some simple debug information that I've created.

I'll go more into detail about the structure of the on screen display system later on in another blog post once all the features are finished. For now I'll just leave you with this nice screenshot from under the world. 

Back to blog