User Interface
Last updated
Last updated
Almost all video games have 2D text or elements on the screen that acts as a HUD. This is accomplished in the Kakara Engine through the User Interface system. In order to add these types of elements to the screen you must use a Canvas. The Kakara Engine has two canvases built in: The ComponentCanvas, ObjectCanvas, and DebugCanvas.
The ComponentCanvas displays UIComponents, which are 2D elements such as: Text, Sprites, Shapes, etc.
To add a ComponentCanvas you construct it in the loadGraphics
method of a Scene.
The object canvas allows you to add 3D objects to the User Interface. 3D objects on the User Interface will always be at the same position on screen no mater what happens to the camera.
The debug canvas is a useful tool to help you debug your game. This canvas is not meant to be used in production.