Samples¶
The companion plugin ArcRmlUISamples holds small samples, one feature each, every one in its own folder: the
document, its style sheet, a README.md and, under Source/ArcRmlUISamples/<Sample>/, its C++ (BlueprintViewModel,
Converter and EditorPreview have none). Run one to see a
feature working, or copy its files into your project as a starting point. The guide's code blocks are copied from these
files.
Install¶
The samples are in the Arc Lunzo Samples repository on GitHub. To run them without a project of your
own, open its ArcRmlUIHost.uproject, which has them set up. To add them to your project:
- Copy the
ArcRmlUISamplesplugin folder (Plugins/ArcRmlUISamplesof the repository) into your project'sPluginsfolder; put it nowhere else, or its content is not found. The plugin has a C++ module (Win64), so the project must build C++. - Add the samples' font sheet to the font settings, in
Config/DefaultGame.ini:+FontSheets=/ArcRmlUISamples/UI/Rml/Fonts/Fonts.rcssin[/Script/ArcRmlUI.ArcRmlUISettings]. - For the samples list and the samples that take keys and the gamepad, the project needs the input setup;
the plugin's
/ArcRmlUISamples/Input/assets provide one. - Restart the editor.
Run a sample¶
Play in the map L_ArcRmlSamples (/ArcRmlUISamples/Maps/). A list of the samples shows in a column at the right edge,
followed by a Blueprint group. Click a sample to open it. A sample on the menu layer hides the list until it closes;
Back (Esc or gamepad B), the sample's own close, or the "Back to samples" button in the top-left corner closes it and the list shows again (Events needs a second Back; BackAndParent does when focus is in its detail area). FirstScreen opens beside the list.
Choosing another sample closes the one opened last.
The console is the second way, and the one to script:
ArcRmlSamples.Open FirstScreen
ArcRmlSamples.Open <Sample>runs the sample's C++ open function, the code its page quotes; the list does the same.ArcRmlSamples.OpenBP <Sample>runs theOpenfunction of the sample's Blueprint Function LibraryBP_<Sample>_Open, for the samples that have one; the list's Blueprint group does the same.ArcRmlSamples.Closecloses the document the last open returned.- Converter has no open function: in the game
ArcRml.Open /ArcRmlUISamples/UI/Rml/Converter/Page.rml. - EditorPreview has no open function: double-click
EditorPreview.rmlin the Content Browser, or in the gameArcRml.Preview /ArcRmlUISamples/UI/Rml/EditorPreview/EditorPreview.rml.
The list and these commands exist outside Shipping builds.
In the table below, the last column names the console command; "Open" is ArcRmlSamples.Open and "OpenBP" is ArcRmlSamples.OpenBP.
The samples¶
| Sample | What it shows | Page | Runs with |
|---|---|---|---|
| FirstScreen | The smallest document: opened and closed from C++ or Blueprint, no view model. | Quick start | Open, OpenBP |
| FieldBinding | A C++ view model with one field of each simple type, shown in the document. | Data binding | Open |
| Events | Events calling view model functions: arguments, mouse buttons, keys, propagation, Back. | Events | Open |
| Lists | A TArray of a struct as a field, shown as rows that can be added and removed. |
Data binding | Open |
| StructList | The same rows held in an FArcRmlStructList. |
Data binding | Open |
| NestedViewModel | A view model whose fields hold other view models. | Data binding | Open |
| SourceContext | Source context: the model from the GameInstance MVVM collection. |
View models | Open, OpenBP |
| SourceResolver | Source resolver: a C++ resolver class creates the model. |
View models | Open |
| SourceManual | Source manual: game code assigns the model with SetViewModel. |
View models | Open, OpenBP |
| SourcePath | Source path: the model read from a property of the player controller. |
View models | Open |
| SourceSettable | settable: game code replaces a context model. |
View models | Open |
| BlueprintViewModel | A view model made in Blueprint, with no C++. | Blueprint view models | OpenBP |
| Component | A component imported twice with dc-import, once by path and once by a head alias, with static and bound props and slots. |
Components | Open |
| LocalState | A component with its own <state>: accordions that open alone, one per :for row, and a slot that reads the outer component's state. |
Components | Open |
| Tailwind | A screen styled only with Tailwind CSS 4 utility classes, built into one .rcss sheet. |
Tailwind CSS | Open |
| Converter | A plain HTML page and what the HTML to RML converter makes of it, with its log. | Converting an HTML page | ArcRml.Open |
| EditorPreview | A view model of stand-in data from a JSON file, with a variant. | Editor preview | ArcRml.Preview |
| GamepadMenu | A menu driven by keyboard and gamepad, with its own action, <kbd action> key labels and Back. |
Input and gamepad | Open |
| FocusAreas | Focus areas, leaving an area, data-focus-contain and navnotarget. |
Navigation reference | Open |
| BackAndParent | Back and data-focus-parent: a child area that Back closes into its parent. |
Navigation | Open |
| TextFields | An <input> and a <textarea> that show the typed and the committed text. |
Text fields | Open |
| TabBar | A tab bar stepped by data-hotkey-cycle, with data-focus-enter into the tab's area. |
Navigation reference | Open |
| DragDrop | Items dragged with the mouse or carried with the keyboard or a pad into slots. | Drag and drop | Open |
| FrameTabs | A frame with an arc-embed box and two tabs that keep their state. |
Frames and tabs | Open |
| Themes | Colour sets switched with custom properties and var(). |
Styling | Open |
| Animations | body.enter and body.leave animations and a pulse:* flash. |
Styling | Open |
| Localization | Texts from a String Table with loc, a plural, and a culture switch. |
Localization | Open |
| WorldMarker | A label placed over a cube in the level with :world. |
World markers | Open |
| Images | Images from a file, a part of a file, a sprite sheet, an SVG and a texture asset, and two bound images the view model swaps. | Images | Open |
| Sounds | Click, hover and focus sounds, and the document's Back and close sounds, declared in a style sheet. | Sounds | Open |
| FormControls | A checkbox, a radio group, a range and a select that show model values and send each change back. | Forms | Open |
| FocusRequest | Buttons that move focus to a text field with :focus-request. |
Navigation reference | Open |
| RowHotkeys | One data-hotkey-focus action that marks the focused row as the favourite. |
Input and gamepad | Open |
| KeepAlive | A menu that opens a keep-alive screen and a preloaded screen, and discards both. |
Keep-alive and preload | Open |
| UmgWidget | A Widget Blueprint with a text block and a document widget that shows a counter document. | A document in a UMG widget | Open |
| UmgLayout | A document widget in a Size Box inside a Scroll Box, between text blocks. | A document in a UMG widget | Open |
| UmgOwnerData | A document whose view model is a property of the Widget Blueprint that holds it, read with path=. |
A document in a UMG widget | Open |
| UmgEvents | A Widget Blueprint graph that handles the open and close requests of the document, and swaps the document. | A document in a UMG widget | Open |
| VirtualList | A list of 10 000 rows in a scroll box, with elements only for the rows near the visible part. | Data binding | Open |
| Aliases | A card that reads the selected hero through a short name from alias:<name>. |
Data binding | Open |
| EmbeddedViews | Two views placed with dc-import: a header that shares the screen's model, and a member card placed once per row and given that row's member. |
Components | Open |
| InnerRml | A model string shown as text with {{ }} and as markup with :rml. |
Data binding | Open |
Packaging the samples¶
With Package Everything on (the default) a packaged build ships the samples' documents. With it off, add their
folder to Paths to Package: +PathsToPackage=/ArcRmlUISamples/UI/Rml in [/Script/ArcRmlUI.ArcRmlUISettings]
of Config/DefaultGame.ini. Most samples open their documents from C++ by a path string, which the cook does not see.
The samples' Blueprints (the BP_*_Open classes) and Widget Blueprints (WBP_Sample_*) are also loaded from C++ by a
path string, so the cook does not see them either. Add the folder to Additional Asset Directories to Cook in
Project Settings > Packaging (+DirectoriesToAlwaysCook=(Path="/ArcRmlUISamples") in
[/Script/UnrealEd.ProjectPackagingSettings] of Config/DefaultGame.ini). The host project has both lines.