Skip to content

1. Menus

Marco Silva edited this page Jun 12, 2024 · 4 revisions

Introduction

In short, a menu is a collection of submenus. They are responsible for propagating player input to the submenus and controlling the flow of the menu. You can also create custom actions that will be generalizaed in the whole menu.

Creating a Menu

To create a menu, add a new User Widget Blueprint with UBaseMenu as the parent class.

Examples

  • Main Menu
  • Pause Menu

Now that you have your menu you can start creating buttons and submenus.

Buttons

To create a new button, add a new User Widget with UBaseButton as the parent class. Buttons are used to create navigation contexts in submenus. They are also a great way to script and customize your button look.

Submenus

Submenus are where you will create the actual look of your menus. You can add whatever you want here. There are also a bunch of events you can use to script your submenus. Next up, you will want to create Navigation Contexts.

Navigation Context

Navigations Contexts are a built-in system to create lists of buttons. They were created to handle keyboard, gamepad and mouse input as one. You can create a navigation context in a submenu, giving it an array of buttons.

image

After creating the context, you can start controlling the navigation index by updating it or offsetting it.

image

To detect the click of a button, you can either bind an event to OnClicked from the button itself, or bind an event to OnNavigationContextClicked.

Clone this wiki locally