Added the UI class! This object is going to hold all visible and invisible UI elements.
Finished the functions in the UI object.
Already simplified the UI object. UI elements should hold a value whether they are visible or not, not their container.
Added the UI element class!
The UI object is renamed to a container object so I can re-use it whenever needed!
The UI container also has a position on screen.
Added the new scripts to the index.html page.
Added the first sub-class of the Element class. The image element is going to be used for showing images on the screen, for example a background behind other UI elements.
The game now holds an UI container, which holds every UI element that there is going to be.
The render system now also draws the UI by calling the render function on the global UI container. This container will render all of it's children.
A container doesn't need a reference to the game. Also added the render function that loops through it's children and calls the render function.
An image now has a source! And the image is displayed on the screen.
Added comments and docblocks to the new UI code.
Added a new TODO: clean up the entire next section, code is very large and could be done a lot better.
Added new TODO: Only draw tiles that are visible within the camera
It's now possible to define a scale to an UI image. The scale is optional and defaults to 1.
Added the Text Element class!
Take the line height in account when placing the text on screen.
The UI container object now also inherits from the UI element class. They share the same properties and functions.
We check if a container is invisible, if it is don't bother rendering all of it's children.