Skip to content

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() and clamp(), aspect-ratio, display: contents, display: list-item with list markers, ::before and ::after with content, and the sizing keywords min-content, max-content and fit-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-* and font-feature-settings reach the font. text-wrap-style: pretty and text-align: justify break and space lines as Chrome does, and -webkit-text-stroke outlines text.
  • Painting: text-shadow, background image layers, masks, dashed, dotted, inset and outset borders, outline, object-fit and object-position, and ::-webkit-scrollbar styling. Shadows and drop-shadow() animate and transition.
  • Selectors and the cascade: :root, :is(), :where(), :dir(), :focus-visible, :focus-within and the form-state pseudo-classes, !important, inherit, initial and unset on every property, CSS nesting, @supports, @property and the full @media condition grammar. Logical properties such as margin-inline map to the physical sides.
  • Colours: currentcolor wherever a colour is accepted, color-mix() in sRGB, and lab(), 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 html with a body child, as an HTML parser builds it, so html { ... } rules match and html is the :root and the rem root.
  • An HTML user-agent style sheet applies: headings, paragraphs, lists and [hidden] get a browser's default style, and input, select, textarea and button get Chrome's default size and look (Forms).
  • Text starts black at 16 px, the CSS initial color and font-size, not white at 12 px, so 1rem is 16 px.
  • line-height starts at normal, the font's line spacing, not 1.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.
  • px is scaled by Unreal's DPI scale, as dp is (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-scrollbar rule replaces it.
  • Data variable names match regardless of case: {{ Id }} reads a field named ID.

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() and callIf() call a BlueprintCallable function of a model from an event, and stopPropagation() stops the event (Events). data-action runs a document action such as close.
  • :key keeps a row's element across inserts and removals (Lists); :virtual creates only the rows in view (Virtual lists).
  • A :if whose condition is false does not create its branch.
  • :world places an element at a point in the world (World markers), pulse:* plays a class when a value changes (Styling), and :focus-request moves focus from the model (Focus requests).
  • preview data 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 navnotarget event when an arrow finds nothing.
  • Navigation enters and leaves scroll containers and skips elements scrolled out of view.
  • :focus and :focus-visible match 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 input and change as in Chrome (Forms).
  • keydown and keyup carry key, 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 .rml and .rcss text when it loads a document. Here each is compiled to a binary .rmlc or .rcssc file: 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 the svg decorator. The fork makes an SVG follow the element's color through currentColor, adds stroke-width, object-fit and object-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).
  • loc puts 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.