Project setup¶
What a project needs before it opens its first ArcRmlUI document. A document that only shows information
(input-mode game, as in the Quick start) needs the plugin and a font; a menu that takes keys
and the gamepad also needs the input setup.
Requirements¶
- Unreal Engine 5.8.
- Win64 is the only supported platform. Other platforms are not supported yet.
- The plugins ArcRmlUI turns on with itself: UMG Viewmodel (
ModelViewViewModel), Common UI Plugin and Enhanced Input; in the editor also Content Browser - File Data Source and GameplayTagsEditor.
Enable the plugin¶
Install ArcRmlUI to the engine: in the Epic Games Launcher, find it under Library > Fab Library and click Install to Engine. Then enable it in Edit > Plugins. It enables the plugins above with itself.
A C++ module that opens documents or defines view models lists the plugin's modules in its
Build.cs: ArcRmlUIData holds FArcRmlDocumentRef, ArcRmlUI the viewport subsystem. Opening documents needs only those two. This excerpt of the samples module's Build.cs also lists the modules its view models use:
PublicDependencyModuleNames.AddRange(
new string[]
{
"Core",
"CoreUObject",
"Engine",
"ArcRmlUIData",
"ModelViewViewModel",
"FieldNotification"
}
);
PrivateDependencyModuleNames.AddRange(
new string[]
{
"ArcRmlUI",
"UMG"
}
);
Where documents live¶
.rml and .rcss files live in the Content folder of the project or of a plugin in the project's Plugins
folder that can contain content, and are named by package path: /Game/UI/Rml/Menu.rml is
Content/UI/Rml/Menu.rml of the project. The guide and the samples keep them under UI/Rml/. They show in the
Content Browser next to the assets.
Fonts¶
ArcRmlUI ships no font. A project declares its fonts in font sheets: style sheets with @font-face rules, loaded
at start; their fonts serve every document. The samples' font sheet:
@font-face {
font-family: 'Arc Samples Sans';
src: /ArcRmlUISamples/UI/Rml/Fonts/AtkinsonHyperlegible-Regular.ttf;
}
In Project Settings > Game > ArcRmlUI > Fonts (Config/DefaultGame.ini, section [/Script/ArcRmlUI.ArcRmlUISettings]):
| Setting | ini key | What it does |
|---|---|---|
| Font Sheets | +FontSheets=/Game/UI/Rml/Fonts/Fonts.rcss |
One line per font sheet, by package path. |
| Fallback Font Family | FallbackFontFamily=Arc Samples Sans |
The family text is drawn with when no style sets one. |
| Generic Font Families | GenericFontFamilies=(("sans-serif", "Arc Samples Sans")) |
Maps a generic name such as sans-serif to a declared family. |
The family in the last two rows must be one that a listed font sheet declares; a name no sheet declares has no effect. These settings take effect after an editor restart.
Layers¶
A document opens on a layer, a UI.Layer.* gameplay tag named by <meta name="layer">; Documents
explains them. The plugin defines four tags, UI.Layer.Game, UI.Layer.GameMenu, UI.Layer.Menu and
UI.Layer.Modal, listed bottom to top in that order by default. A document that names a layer missing from the order
is an error; the order is Project Settings > Game > ArcRmlUI > Layers > Layer Order.
Input for menus¶
A document with input-mode menu or all takes keys through CommonUI:
- Confirm is always Enter, Space or the gamepad's accept button, and presses the focused element. The click action of the CommonUI input data only supplies the key label a document shows for Confirm.
- Back is the back action of the CommonUI input data. A Back that no handler stops closes the document.
So the project needs its own Confirm and Back actions, one project-wide mapping context and the CommonUI input data that names the two actions:
- Make the game use the CommonUI viewport client: in Project Settings > Engine > General Settings > Default Classes
set Game Viewport Client Class to
CommonGameViewportClient(GameViewportClientClassNamein[/Script/Engine.Engine]). - In Project Settings > Engine > Input > Default Classes set Default Player Input Class to
EnhancedPlayerInputand Default Input Component Class toEnhancedInputComponent. - In the Content Browser create two Input Actions (Input > Input Action), for example
IA_ConfirmandIA_Back. - Create an Input Mapping Context (Input > Input Mapping Context). Map Enter, Space and the gamepad's bottom face button to Confirm, Esc and the gamepad's right face button to Back. These keys are also the labels a document shows for Confirm and Back.
- Add the context in Project Settings > Engine > Enhanced Input > Default Mapping Contexts with Add Immediately on.
- In Project Settings > Game > Common Input Settings turn on Enable Enhanced Input Support and restart the editor; the Blueprint's Enhanced Input fields stay hidden until then.
- Create a Blueprint class with the parent Common UI Input Data. Set its Enhanced Input Click Action to
IA_Confirmand its Enhanced Input Back Action toIA_Back. - In Common Input Settings set Input Data to that Blueprint.
A menu document whose Back action has no key logs a warning when it opens. Keep Confirm and Back out of a document's own mapping context.
The ready-made input assets come with the samples plugin, under /ArcRmlUISamples/Input/
(IA_Sample_Confirm, IA_Sample_Back, IMC_Sample_Common, BP_SampleInputData). A project without its own setup
can use them instead of the steps above by adding each block below to the file in its title:
[/Script/Engine.Engine]
GameViewportClientClassName=/Script/CommonUI.CommonGameViewportClient
[/Script/CommonInput.CommonInputSettings]
bEnableEnhancedInputSupport=True
InputData=/ArcRmlUISamples/Input/BP_SampleInputData.BP_SampleInputData_C
[/Script/Engine.InputSettings]
DefaultPlayerInputClass=/Script/EnhancedInput.EnhancedPlayerInput
DefaultInputComponentClass=/Script/EnhancedInput.EnhancedInputComponent
[/Script/EnhancedInput.EnhancedInputDeveloperSettings]
+DefaultMappingContexts=(InputMappingContext="/ArcRmlUISamples/Input/IMC_Sample_Common.IMC_Sample_Common",Priority=0,bAddImmediately=True,bRegisterWithUserSettings=False)
IMC_Sample_Common maps Enter, Space and gamepad A to IA_Sample_Confirm, Esc and gamepad B to
IA_Sample_Back; these lines are the ini form of steps 1, 2, 5, 6 and 8. Restart the editor after changing them. The Input and gamepad page
covers navigation, hotkeys and a document's own mapping context.
Packaging¶
The settings are under Project Settings > Game > ArcRmlUI > Packaging.
- The folder
UI/Rml/Test/of a content root is never packaged, whatever the settings below say, and the editor does not create a document there. - Package Everything on (the default): a packaged build ships every document and style sheet of every content root, compiled.
- Package Everything off: Paths to Package lists the folders or files to ship
(
+PathsToPackage=/Game/UI/Rml/MenusinConfig/DefaultGame.iniunder[/Script/ArcRmlUI.ArcRmlUISettings]). The cook also adds the frames of what it ships (documents that show other documents, see Frames and tabs), the documents thatdata-action="open:<package path>"names as a literal, the documents that Blueprints and data assets reference, and the documents listed in Documents To Preload (Keep-alive and preload). - A Game Feature plugin lists its own paths with the action Package RML Documents (
UArcRmlGameFeatureAction_PackageDocuments) of the companion plugin ArcRmlUIGameFeatures, which does not ship with this plugin (it isPlugins/ArcRmlUIGameFeaturesof the Arc Lunzo Samples repository). The cook packages them when that Game Feature plugin is enabled on the platform, so they need no entry in Paths to Package. A path outside the plugin is a cook error. - The font sheets always ship.