Skip to main content

Custom UI

The template ships built-in C++ screens with one fixed look (sober black and white, slanted panels). Your game's UI is your own widgets: design each screen as you want in UMG, and tell the UI Policy to use it. There is no theme to fill: the built-in look has no settings, and a screen you replace keeps nothing of it.

Your own UI Policy​

  1. Duplicate /AFT/UI/DA_AFT_UIPolicy (an AFT UI Policy, UAFTUIPolicy) into your project.
  2. Set it in Project Settings > AFT Game > UI > UI Policy.
  3. Set the Screens you replace (and optionally your LayoutClass). Screens that are not set keep the built-in C++ screen.
PropertyDescription
LayoutClassRoot widget with the layers (empty = UAFTPrimaryLayout, see Primary layout).
ScreensWidget class of each screen (Title, MainMenu, CharacterSelect, BattleHUD...). Empty = the built-in screen.
SettingsTabs and rows of the settings screen.
ControllerSilhouettesController silhouettes (see below). Empty = /AFT/UI/DA_AFT_ControllerSilhouettes.
NavigateSound, ConfirmSound, BackSound, ErrorSound, NotificationSoundUI sounds played by every AFT screen, built-in or yours (empty in the template).
NotificationDuration, bControllerDisconnectAlert, bLoadingScreenOnTravelFeedback options.
Per-screen settings

AFT Game > UI also has one class setting per screen (TitleScreenClass, BattleHUDClass, TrainingHUDClass...). When set, they override the policy, which is handy to test a single screen.

Replace a screen with a Widget Blueprint​

  1. Content Browser > right click > User Interface > Widget Blueprint, and pick the screen class as parent (for example AFTCharacterSelectScreen).
  2. Design it freely. As soon as the Widget Blueprint has a designer tree, the built-in look is skipped.
  3. Use the state and events the screen exposes (for the character select: Get Roster, Get Cursor, Is Team Ready, On Selection Changed; every screen: On Menu Action, Send Menu Action). The navigation logic stays in C++.
  4. Assign the class to its entry in the Screens of your UI Policy (CharacterSelect for this example).

The same works for every screen listed in UI Overview, including the battle HUD (implement On HUD Update) and the training HUD (implement On Training Update). A screen can also be any CommonUI activatable widget of your own: the AFT parent classes only save you the input, navigation and data code.

Blueprint helpers (category AFT | UI): Play UI Sound(Sound) plays a sound of the policy, Get Controller Silhouettes, and Get Game Title (the name shown by the built-in title screen, from Project Settings > Description: Project Displayed Title, else the Project Name).

The built-in look​

The built-in screens build their layout in C++ on a 1920 x 1080 design canvas (they scale to any resolution), with the fixed style UAFTUIStyle: colors, the Roboto font of Font_AFT_Global (Apache 2.0) and the textures of /AFT/UI/Textures. It is not an asset and has no settings: to change the look of a screen, replace the screen.

In C++, FAFTWidgetBuilder (UI/AFTUIWidgets.h) builds the pieces of the built-in look (Slab, SlabArt, Outline, TitleBand, ModeChip, PlayerTab, StateTag, Chip, Arrow, DeviceArt, Watermark, PaperBackground, Throbber, Place): reuse them in your own C++ screens if you want the same look.

Fighter art​

The menus use the UI textures of each fighter data asset: Icon (roster cells, HUD, result), Portrait (fallback) and FullArt (main menu, result, and the character select with the static image). By default the character select shows the fighters in 3D instead. Quinn's images were rendered with the Character Render Studio in its Manga look (posterized tones and an ink outline): its Update Fighter Images button renders and assigns the three images of any fighter. Replace them with your own art if you prefer.

Controller silhouettes​

Fighting games show the controller of a human player and a CPU badge for a computer opponent. AFT Controller Silhouettes (UAFTControllerSilhouettes, /AFT/UI/DA_AFT_ControllerSilhouettes, set in the policy ControllerSilhouettes) holds one entry per controller type (DisplayName, Body texture, optional Accent texture tinted in the player color, MarkPosition of the 1P / 2P mark), plus GenericGamepad, KeyboardLeft, KeyboardRight and CpuBadge. The entry of a device is found from:

  1. the hardware identifier of the device (UInputDeviceSubsystem), matched against HardwareIdentifiers (substrings such as DualSense, XInput);
  2. else the CommonInput gamepad name of the player (GamepadNames, for example PS5, XSX);
  3. else the generic gamepad.

Add your own entries (one texture per device): the CommonInput controller data textures are not used for this.

Primary layout​

Without a designer tree, UAFTPrimaryLayout creates its layer stacks itself. To arrange them yourself, derive a Widget Blueprint from UAFTPrimaryLayout, add Common Activatable Widget Stack widgets named GameLayer, GameMenuLayer, MenuLayer, ModalLayer and SystemAlertLayer (optional bindings: add the layers your game uses), and set it as the LayoutClass of the policy.

Button icons​

  • Menu actions (information bar, UAFTInputHintWidget): the key comes from the AFT bindings of the player's device (gamepad, left / right keyboard), the icon from the CommonInput controller data of the platform (Project Settings > Common Input, [CommonInputPlatformSettings_<Platform>] in the game ini: keyboard, Xbox Series, Xbox One, PS4, PS5, Switch). Keys without icon are drawn as a key cap sized on the key name.
  • Attack buttons and directions (input log and move lists of the built-in training tools): T_UI_L_Punch, T_UI_M_Punch, T_UI_H_Punch, T_UI_L_Kick, T_UI_M_Kick, T_UI_H_Kick, T_UI_Up... (/AFT/Game/TextureLibrary/UI/Input). Buttons without icon use a colored chip with the project button name (AFT Core > Input > Button Names). In your own widgets, use your own icons.

Information bar

The information bar: the message of the screen and its button hints, with the key of each menu action for the player's device.

Widgets for your own layouts​

These widgets are in the UMG palette under AFT:

WidgetUse
AFT Input Hint (UAFTInputHintWidget)Platform icon of a menu action and a label: Action, Label, PlayerSlot (whose device is shown), IconSize, FontSize.
AFT Frame Meter (UAFTFrameMeterWidget)Frame meter of the current battle. See Training Mode.
AFT Input Log (UAFTInputLogWidget)Input history of a team.