Coming from RmlUi¶
ArcRmlUI draws documents with its own fork of RmlUi, based
on RmlUi 6.4-dev (upstream revision 96fda45). If you know RmlUi, the markup and the style sheets will look familiar:
RML, RCSS, data binding, decorators and nav are all there. It is not the same library. The fork changes
CSS layout, text and painting to behave like Chrome, and the plugin replaces RmlUi's application side (your own backend,
data models registered in C++, Lua) with Unreal. This page lists the differences by what you get, and links the page
that has the detail.
CSS closer to a browser¶
The fork adds CSS that RmlUi does not have, and lays out and paints it as Chrome does. The complete list, with what is still missing, is CSS support.
- Layout: CSS Grid (
grid,inline-grid, no subgrid),calc(),min(),max()andclamp(),aspect-ratio,display: contents,display: list-itemwith list markers,::beforeand::afterwithcontent, and the sizing keywordsmin-content,max-contentandfit-content. Table column widths, row heights and collapsed borders follow Chrome's table layout. - Text: text is shaped with HarfBuzz, and the OpenType features of
font-variant-*andfont-feature-settingsreach the font.text-wrap-style: prettyandtext-align: justifybreak and space lines as Chrome does, and-webkit-text-strokeoutlines text. - Painting:
text-shadow,backgroundimage layers, masks, dashed, dotted, inset and outset borders,outline,object-fitandobject-position, and::-webkit-scrollbarstyling. Shadows anddrop-shadow()animate and transition. - Selectors and the cascade:
:root,:is(),:where(),:dir(),:focus-visible,:focus-withinand the form-state pseudo-classes,!important,inherit,initialandunseton every property, CSS nesting,@supports,@propertyand the full@mediacondition grammar. Logical properties such asmargin-inlinemap to the physical sides. - Colours:
currentcolorwherever a colour is accepted,color-mix()in sRGB, andlab(),lch(),oklab(),oklch().
RmlUi's own extensions stay: decorator, font-effect, @spritesheet, nav and the rest of
RmlUi-only.
Defaults that differ from RmlUi¶
A style sheet written for stock RmlUi can look different here, because the fork starts from a browser's defaults:
- The tree is
htmlwith abodychild, as an HTML parser builds it, sohtml { ... }rules match andhtmlis the:rootand theremroot. - An HTML user-agent style sheet applies: headings, paragraphs, lists and
[hidden]get a browser's default style, andinput,select,textareaandbuttonget Chrome's default size and look (Forms). - Text starts black at 16 px, the CSS initial
colorandfont-size, not white at 12 px, so1remis 16 px. line-heightstarts atnormal, the font's line spacing, not1.2.rgba()alpha is 0 to 1 or a percentage, as in CSS, not RmlUi's 0 to 255:rgba(0, 0, 0, 128)is opaque.pxis scaled by Unreal's DPI scale, asdpis (CSS px and dp, Screen size, cursor and players).- White space between elements is kept and collapsed as Chrome collapses it; RmlUi drops a text node that holds only white space.
- An unstyled scroll container shows Chrome's native scrollbar; a
::-webkit-scrollbarrule replaces it. - Data variable names match regardless of case:
{{ Id }}reads a field namedID.
Binding attribute names¶
Binding attributes have short names instead of RmlUi's data- names. An RmlUi name such as data-for is a plain
attribute here: it binds nothing and reports no error.
| RmlUi | ArcRmlUI |
|---|---|
data-model, data-if, data-for, data-value, ... |
:model, :if, :for, :value, ... |
data-class-active, data-style-color, data-attr-src |
class:active, style:color, attr:src |
data-event-click |
on:click |
The full list is in Attribute reference.
Data binding through Unreal view models¶
In RmlUi, game code builds a data model in C++ and the document names it with data-model. Here the document declares
each model in its head with <viewmodel>: an Unreal MVVM view model (UMVVMViewModelBase) made in C++ or Blueprint,
which the document creates or finds through a source. :model names that declaration. The plugin
binds the model's Field Notify fields, and the document updates when the model broadcasts a change; nothing is
registered by hand (Concepts, Data binding).
What the document can do with a model goes beyond RmlUi's data bindings:
call()andcallIf()call aBlueprintCallablefunction of a model from an event, andstopPropagation()stops the event (Events).data-actionruns a document action such asclose.:keykeeps a row's element across inserts and removals (Lists);:virtualcreates only the rows in view (Virtual lists).- A
:ifwhose condition is false does not create its branch. :worldplaces an element at a point in the world (World markers),pulse:*plays a class when a value changes (Styling), and:focus-requestmoves focus from the model (Focus requests).previewdata shows a document in the editor without the game (Editor preview).
Components¶
A component is an .rml file with props and slots that a document imports with <dc-import> (by package path or a <link rel="component" as> alias from its head); the plugin expands it
when the document is compiled (Components).
Input, focus and gamepad¶
Input reaches documents through CommonUI and Enhanced Input, with a per-document input mapping and CommonUI's Back (Input and gamepad). The fork's spatial navigation adds what a gamepad menu needs:
- Focus areas keep the arrows and the D-pad inside one part of the screen, with
rules for leaving an area,
containing focus and a
navnotargetevent when an arrow finds nothing. - Navigation enters and leaves scroll containers and skips elements scrolled out of view.
:focusand:focus-visiblematch only the focused element.- Form controls work by pad: a select opens, moves its highlight and picks with the pad, and checkboxes, radios and range
inputs send
inputandchangeas in Chrome (Forms). keydownandkeyupcarrykey, the key as a browser names it (Event reference).
Unreal integration¶
RmlUi leaves rendering, input, files and fonts to the application. The plugin supplies them for Unreal:
- Documents open per local player on CommonUI layers, from C++, Blueprint or the console, and are drawn on the plugin's own thread (Concepts).
- RmlUi parses the
.rmland.rcsstext when it loads a document. Here each is compiled to a binary.rmlcor.rcsscfile: the editor compiles it when its source changes, the cook compiles what it ships, and a packaged build reads only the compiled files and ships no sources (Compiled files). - Images can be Unreal texture assets (
asset:), and image files and SVGs are decoded in the background (Images). - SVG comes from RmlUi's SVG plugin with lunasvg:
<svg>with a file or inline content, and thesvgdecorator. The fork makes an SVG follow the element'scolorthroughcurrentColor, addsstroke-width,object-fitandobject-position, and keeps the last image while a new size or colour is drawn.<img>does not draw SVG, and filters and animation inside an SVG are not drawn (SVG). locputs a text into a String Table and follows the culture (Localization).- Frames and tabs, keep-alive and preload, UI sounds and drag and drop by mouse or pad.
- Tools in the editor: Editor preview, the inspector, Validation, the HTML converter, and Tailwind CSS through Tailwind's own tool.
Not included¶
These parts of the RmlUi project are not in the plugin:
- Lua: no scripting. A
<script>is a compile error (Coming from HTML and CSS). - The debugger: the inspector shows the element tree, the box and the rules instead.
- Lottie: no Lottie element.
- Backends and samples: the plugin renders through Unreal, and has its own samples.
For what the plugin cannot do, see Limits.