Game UI Components

As you may know, Cave Engine allows you to create custom in game UIs by using some Builtin Components. Here you'll find their available Python APIs.

cave.UIElementComponent

Variables

If the Element have a Font, you can type texts in it do be displayed in your game. For this, use the text variable:

text : str

In order to position and scale your UI element, you can use those variables:

position : cave.UIVector
scale    : cave.UIVector

_ Note: Read the cave.UIVector's Documentation in the Math section of this API._

You can change the component's color by adjusting one of those variables:

quadAlpha : float
quadColor : cave.Vector
Methods

To see if the user is hovering your UI element, you can use thid method:

isHovered() -> bool