Aperture UI
Getting started

What is Aperture UI

UI middleware that turns HTML, CSS and JavaScript into draw commands for your game's renderer, and the workflow from authoring a screen to shipping it.

Aperture UI is UI middleware for games, built by WD Studios LLC as a C++17 library. Your team builds screens (menus, HUDs, inventories, settings) in HTML, CSS and JavaScript. The engine parses the markup, runs the scripts, lays the page out and produces a list of draw commands. Your title submits that list to its own renderer.

The engine owns no window, no swap chain and no input loop. Your title creates a view, calls tick() and buildCommandList() once per frame, and forwards input to the view.

A title under US$100,000 in gross revenue uses Aperture UI free after its company accepts the Free Agreement. A larger title buys a revenue band. See Licensing in practice and pricing.

What is in it

  • HTML and CSS. The Gumbo HTML5 parser, the CSS cascade and selectors, and layout for block, inline, flexbox (Yoga), grid, table and multi-column content. Transforms, transitions, animations, gradients, filters and blend modes.
  • JavaScript. V8 15.6.75.12, with DOM bindings generated from WebIDL: window, document, events, timers, MutationObserver, ResizeObserver, the Web Animations API, fetch, XMLHttpRequest, WebSocket and 2D canvas.
  • Text. Shaping, bidirectional text and wrapping from the Skribidi text library (break opportunities in inline layout come from ICU), @font-face fonts and bundled fallback fonts.
  • Images and graphics. Raster images, SVG (LunaSVG) and Lottie animations (rlottie). <video> needs a build with the video stack (APUI_HAS_VIDEO). The SDK packages are PartialCore builds, which leave it out.
  • A renderer interface. The view produces a HarrlowCommandList. SimpleAPHIRenderContext is the base class for the backend that draws it; APPlayer's D3D11 and Vulkan contexts are the reference implementations.
  • C++ and JavaScript together. The binder facade (APUICreateBinder, APUIRequestNativeFunction) exposes native functions to scripts, and DataBindEngine evaluates data-bind-* attributes against a model your game publishes. See Scripting.
  • DevTools. Chrome DevTools attach to a running view through the DeveloperEngine, a Chrome DevTools Protocol server that your host starts. The 26.08.0.1 Windows package includes a working server and frontend; the host must start and tick it. A custom PartialCore build can still select the stub network implementation.
  • Engine plugins. An Unreal plugin and an O3DE gem, or embed the C++ SDK in your own engine. See Integration.

The engine is tested page by page against Chrome rather than against the CSS specifications as a whole. A feature that no test covers can differ from Chrome. Web platform support lists the pages that are tested.

How a frame flows

Your game
  |  IAPCPlatform interfaces (file system, logging, memory), then ApertureSDK::Initialize()
  v
UIView            one per screen: DOM, scripts, input state
  |  tick(dt)             style, layout, animations, timers, JavaScript
  |  buildCommandList()   paint into a HarrlowCommandList
  v
Your render context (APHIRenderContext)     draws the list on D3D11, Vulkan or your engine's renderer

tick() advances time: CSS animations, transitions, timers and requestAnimationFrame callbacks move only when you call it. buildCommandList() is what paints. Input goes through the view's own methods (onMouseMove, onKeyDown and the rest) so hit testing, hover and focus stay consistent.

The workflow

A project splits into two tracks that meet at integration:

  • Content authoring. HTML, CSS, JavaScript, fonts and images, written by designers and front-end developers.
  • Engine integration. C++ that creates views, ticks them, forwards input and draws the command list. This is a one-time job per title. The Unreal plugin and the O3DE gem do much of it for you: see Integration.

Author in a browser first

A menu, HUD, inventory or settings screen can be built in a normal browser with the usual tools: an editor, browser DevTools, hot reload and npm. You need the engine itself only for the parts a browser cannot show:

  • Native functions that page script calls, and the data your game pushes to the page.
  • How the UI composites into your game frame.
  • Frame time. A browser's timing says little about a game loop.

Check the page in the engine early. Aperture UI is tested against Chrome, but a page you have not run in the engine is a page you have not tested.

Load content through your file system

HTML, CSS, JavaScript, fonts, images, SVG and Lottie JSON all load through IAPCFileSystem. The stock implementation reads from disk under a root folder you give it. A title that packs assets into an archive subclasses it to read from the archive. See Project structure.

Three calls per frame

view->tick(deltaSeconds);                          // advance time, run scripts and animations
const auto& commands = view->buildCommandList();   // paint
renderContext->SubmitHarrlowCommands(commands);    // draw, through your backend

Input is the third part: forward mouse, wheel, touch and keyboard events to the view as they arrive. Your first view walks through the full setup.

Debug a running view

Chrome DevTools connect to a view that your host exposes through the DeveloperEngine: inspect the DOM, edit CSS, set JavaScript breakpoints, profile and scrub animations. APPlayer starts it for you. The RuntimeBuild contains apertureuideveloperengine.dll in every configuration, and the server opens a debugging port, so start it only in builds that stay inside your team. The PartialCore packages carry a DevTools stub that never listens; connecting needs a full engine build.

Build configurations

The SDK's binaries come in three configurations: Debug, Dev and Shipping. A development build (Debug or Dev binaries) verifies the project key and signed title certificate locally. A Shipping SDK validates the certificate without a development key. License checks do not contact a server. Give players only shipping builds. The rules are in Licensing in practice.

Next

On this page