Button Actions

In addition to specialized forms of navigation and UI, VNgen features a general purpose buttons system which can be used for both in-game functions and main menus themselves. Taking action based on which button is selected might seem complex at first, but the open-ended nature of VNgen buttons is precisely what makes them so powerful.

Simply put, there is no predetermined outcome when a user selects a given button. Rather, that button's ID is stored in memory where it can be read and used in conditional statements like if and switch to execute code of your own based on the result. Check out the Getting Started guide for a full breakdown of this process using options as an example.

In this section we'll examine available button functions so you'll be off to creating menus in no time!

tip

Buttons ignore the engine pause state, meaning you can even create pause menus with them!