Aperture UI
Getting started

Project structure

The layout of the SDK package, the files your game ships, and how to organise your UI content.

The SDK package

The package you download from the portal is a RuntimeBuild. The engine's packaging step (package_runtime_build) assembles it for one configuration (Debug, Dev or Shipping):

RuntimeBuild/
├── LICENSE.md                  The SDK licence
├── THIRD_PARTY_NOTICES.md      The licences of the third-party components in the package
├── MANIFEST.md                 Commit, branch, configuration and build date of this package
├── bin/                        Engine, V8, ICU, OpenSSL and audio-codec DLLs
│   └── resources/              snapshot_blob.bin, icudtl.dat, v8_icudtl.dat
├── lib/                        Import libraries (.lib)
├── include/                    Public headers
│   ├── APHTML/                 The engine: APEngine.h, API/APUIView.h, Interfaces/, Script/, DOM/ ...
│   ├── APHarrlow/              Command lists and render context base classes
│   ├── DeveloperEngine/        The DevTools server
│   ├── NetworkEngine/          The network provider
│   ├── FontEngine/, Foundation/, Texture/, ThirdParty/Skribidi/include/
│   └── SDKBuildInfo.h
├── shaders/                    HLSL and GLSL shader sources; Vulkan/ holds compiled SPIR-V
├── data/
│   ├── Base/Fonts/             Bundled fallback fonts, with their licences
│   ├── JavaScript/             browser_protocol.json (the DevTools protocol definition) and other script data
│   └── apdevtools/front_end/   The Chrome DevTools frontend
└── cmake/ApertureUIConfig.cmake

Debug and Dev packages also carry .pdb files in bin/; a Shipping package does not. The package holds the engine, its headers and its data. It holds no host application and no samples.

Keep bin/, resources/ and data/ from the same package together. The V8 snapshot, the ICU data, the DevTools frontend and the DLLs belong to one build. When you update the SDK, replace all of them at once.

The Unreal plugin keeps its own copy of the RuntimeBuild under ThirdParty/ApertureUI. See Requirements for what each DLL does and how to link.

Your game's directory

A shipped title that reads its UI from disk looks like this:

MyGame/
├── MyGame.exe
├── apertureuihtmlengine.dll        Everything from the package's bin/ that your game needs
├── apertureuiharrlowengine.dll
├── wdtier0.dll
├── ...
├── resources/
│   ├── snapshot_blob.bin
│   ├── icudtl.dat
│   └── v8_icudtl.dat
├── data/
│   └── Base/Fonts/                 Fallback fonts
├── aperture.license                Signed title certificate
└── ui/                             Your HTML, CSS, JavaScript, fonts and images
  • The DLLs and resources/ go next to the executable, or on the DLL search path.
  • aperture.license, the title certificate, goes next to the executable. See Licensing in practice.
  • A development build can add apertureuideveloperengine.dll, apertureuinetwork.dll, libssl-3-x64.dll, libcrypto-3-x64.dll and data/apdevtools/front_end/ so Chrome DevTools can attach, the 26.08.0.1 Windows package accepts connections when the host starts and ticks the server; see Requirements. Leave them out of what you give to players.

A game that packs its assets

If your game keeps content in an archive (.pak, .vresources, an asset bundle), subclass IAPCFileSystem and read from the archive. Override GetFileData, FileExists, DirectoryExists and EnumerateFiles, plus RequestCreateFile if scripts use localStorage. The engine calls into your class whenever:

  • A stylesheet, script, font or image is requested, whether by a tag, @font-face, @import or url().
  • localStorage writes its data file.
  • The font engine looks for its bundled fonts.

Two limits of the base class apply to a subclass in this SDK version:

  • loadHtmlFromFile reads the document itself from disk, through GetFileDataTrusted. That function is not virtual, so your subclass does not see the read. The engine uses the same call to read the localStorage data file back, and to read the Windows system fonts it registers. The bundled fonts are found with FileExists and then opened from disk directly, so keep them as real files (see File system).
  • The destructor of IAPCFileSystem is not virtual. Own your subclass through its own type, such as std::unique_ptr<MyArchiveFileSystem>, not through a pointer to IAPCFileSystem.

Containment is part of the base class. If you override GetFileData, enforcing the boundary between page content and the rest of your archive is your job. File system covers the roots, the overrides and localStorage. See How Aperture UI differs from a browser for the rules the stock class applies.

Resources and data

FileNeededPurpose
resources/snapshot_blob.binYesV8 startup snapshot
resources/icudtl.datYesV8's ICU data. Startup validation (validateResourcesOnInit, on by default) looks for this file and fails without it.
resources/v8_icudtl.datShip itThe same data. When it is present, ICU loads this file instead of icudtl.dat.
data/Base/Fonts/For textThe bundled fallback fonts
data/apdevtools/front_end/DevTools onlyThe Chrome DevTools frontend
data/JavaScript/browser_protocol.jsonDevTools onlyThe DevTools protocol definition the DevTools server reads

Organising your UI content

Group by screen, not by file type: one HTML file, one stylesheet and one script per screen, and a shared/ folder for what several screens use.

ui/
├── main-menu/
│   ├── index.html
│   ├── main-menu.css
│   └── main-menu.js
├── hud/
│   ├── hud.html
│   ├── hud.css
│   └── hud.js
├── inventory/
└── shared/
    ├── fonts/
    ├── images/
    └── components/
        └── button.css

URLs

  • Use relative URLs. href="main-menu.css" resolves against the document, and href="../shared/components/button.css" reaches the shared folder.
  • A path that leaves the UI resources root, the document's folder and your trusted roots is blocked and logged. Put shared files under the UI resources root, or call IAPCFileSystem::AddTrustedRoot for the folder that holds them.
  • http:// and https:// URLs need a network provider. See How Aperture UI differs from a browser.

On this page