RuntimesGodot 4 · Unity 6 · Web

Three native runtimes for one document.

Your game loads the same .envy.json file the editor saves. Godot builds Control nodes from it, Unity builds UI Toolkit elements, the browser builds plain elements, and none of them needs generated UI code.

Godot addon

The EnvyUI node rebuilds the document from Panels, Containers and Labels at runtime, so focus, gamepad and input stay Godot's own. In Godot 4.6+, import .envy.json as a resource and edits show up while the game runs.

Engine
Godot 4.6 or newer
Language
GDScript, nothing to compile
Folder
addons/envy_ui

Unity package

The EnvyUI component rebuilds the document in UI Toolkit at runtime, with keyboard and gamepad navigation from either input system. .envy.json files import as assets, and edits show up while the game runs in the editor.

Engine
Unity 6.3 or newer
Language
C#, as source
Package
com.mythicbrain.envy-ui
</>

Web runtime

One script renders the document to plain elements. The editor canvas uses the same renderer, so the canvas and the game can't drift apart.

Size
65 KB gzipped
Dependencies
None
File
envy-runtime.js
▶

Playable HTML

Export one HTML file with the runtime and your document inside. Send it to anyone who should click through the interface.

Needs
A browser
Includes
States, data, animation
Export
Hand off › HTML

Runtime comparison

Same .envy.json document across every target.

AspectGodot addonUnity packageWeb runtimePlayable HTML
Native outputControl, Container, Button and Label nodesUI Toolkit VisualElement treePlain DOM elementsSelf-contained HTML file
Minimum versionGodot 4.6 or newerUnity 6.3 or newerAny current browserAny current browser
LanguageGDScript (nothing to compile)C# (source package)JavaScript (no dependencies)Bundled script and document
Footprintaddons/envy_ui/ foldercom.mythicbrain.envy-ui65 KB gzippedOne file to share
Live reloadWatches .envy.json in editorReloads .envy.json in Play modeReload via mount() or fetchStatic snapshot for sign-off
Focus and inputGodot FocusMode and neighborsInput System and Input ManagerKeyboard and Gamepad APIKeyboard and Gamepad API
LicenseMITMITMITMIT runtime inside

The web runtime, running here

Click, use the arrow keys and Enter, or plug in a controller. On the boss fight, Esc opens the pause menu as an overlay.

Live runtime
The Last Hunt title screen

Add it to your game

Each takes a few lines. The quick start walks through it.

Godot

  1. Copy addons/envy_ui into your project and enable the plugin.
  2. Put the document in res://ui/. In Godot 4.6+ it imports as an EnvyDocument resource.
  3. Add an EnvyUI node, or create one from code.
var ui := EnvyUI.new()
ui.document_path = "res://ui/the_last_hunt.envy.json"
add_child(ui)
ui.ui_event.connect(func(event, payload):
	if event == "new_hunt": start_new_hunt())
ui.set_data("player.hp", 212)
ui.focus_first_button()

Unity

  1. Export the Unity package from Envy and unzip it into your project, next to Assets/.
  2. The document in Assets/UI/ imports as an EnvyDocument asset.
  3. Add an EnvyUI component, or let a script add it.
var ui = gameObject.AddComponent<EnvyUI>();
ui.LoadDocument(document); // the imported .envy.json
ui.UiEvent += (evt, payload) => {
    if (evt == "new_hunt") StartNewHunt();
};
ui.SetData("player.hp", 212);
ui.FocusFirstButton();

</>Web

  1. Load envy-runtime.js. It defines the global Envy.
  2. Fetch the document.
  3. Mount it into any element.
<script src="envy-runtime.js"></script>
<script type="module">
  const doc = await fetch("ui/the_last_hunt.envy.json").then((r) => r.json());
  const ui = Envy.mount(document.getElementById("ui"), doc, { screen: "02 Main menu" });
  ui.on("new_hunt", () => game.startHunt());
  ui.setData("player.hp", 212);
</script>

API reference

The same verbs in every runtime.

EnvyUI Godot · GDScript

Properties
documentAn EnvyDocument resource (an imported .envy.json). Reloads while the game runs
document_pathOr a path to the .envy.json file
start_screenScreen to show first. Defaults to the first screen
scale_modeFIT scales the design resolution into the node and stretches to its aspect
autoplayPlay autoplay animations when a screen shows
use_sample_dataStart with the document's sample data
hot_reloadPick up a re-imported document while the game runs
localeLocale for translated text, like "de" or "pt-BR"
fontsFamily name to a Font resource, for fonts the document does not embed
cancel_closes_overlayui_cancel (Esc, gamepad B) closes the top overlay
Methods
goto(screen, transition)Show a screen by name or id
push(screen, transition) · pop()Open a screen over the current one, close the top one
get_stack() · get_screen_names()The open screens, every screen
set_data(path, value)Set one data path, for example "player.hp"
merge_data(patch) · get_data(path)Deep-merge a dictionary, read a value
play(anim) · stop(anim) · is_playing(anim)Run the document's animations
set_locale(locale) · get_locales()Switch language at runtime
get_control(name_or_id)The Control built for a layer
focus_first_button()Start keyboard and gamepad navigation
load_document(path) · load_resource(res)Load another document
Signals
ui_event(event, payload)A button emitted an event
screen_changed(screen_name)goto, push or pop ran
data_changed(data)A button set or toggled data
document_reloadedThe document changed on disk and was reloaded

EnvyUI Unity · C#

Inspector fields
documentAn imported .envy.json or .envy (an EnvyDocument asset). Reloads while the game runs in the editor
documentJson · documentPathOr a TextAsset, or a file path (absolute, or under StreamingAssets)
startScreenScreen to show first. Defaults to the first screen
scaleModeFit scales the design resolution into the panel and stretches to its aspect
autoplay · useSampleDataPlay autoplay animations; start with the document's sample data
hotReloadReload the document when Envy saves over it, in the editor
localeLocale for translated text, like "de", or "pseudo"
cancelClosesOverlayCancel (Esc, gamepad B) closes the top overlay
fontsFamily and weight to a font asset or a TTF/OTF Font, for fonts the document does not embed
panelSettings · sortingOrderThe panel EnvyUI draws in; empty draws 1:1 over the scene
Methods
Goto(screen, transition)Show a screen by name or id
Push(screen, transition) · Pop() · Cancel()Open a screen over the current one, close the top one
GetStack() · GetScreenNames()The open screens, every screen
SetData(path, value)Set one data path, for example "player.hp"
MergeData(patch) · GetData(path)Deep-merge a dictionary, read a value
Play(anim) · Stop(anim) · IsPlaying(anim)Run the document's animations
SetLocale(locale) · GetLocales()Switch language at runtime
GetElement(nameOrId)The VisualElement built for a layer
FocusFirstButton() · Press(button)Start keyboard and gamepad navigation; press a button from code
LoadDocument(asset) · LoadFile(path) · LoadJson(text)Load another document
Events
UiEvent(evt, payload) · onUiEventA button emitted an event (a C# event, and a UnityEvent for the Inspector)
ScreenChanged(name) · onScreenChangedGoto, Push or Pop ran
DataChanged(data)A button set or toggled data
DocumentReloadedThe document changed on disk and was reloaded

Envy Web · JavaScript

Entry point
Envy.mount(host, doc, opts)Mount a document into an element and run it. Returns a player
opts.screen · opts.dataFirst screen; initial data (defaults to the sample data)
opts.localeLocale for translated text, or "pseudo"
opts.scaleMode"fit" (default) or "none"
opts.autoplay · opts.gamepadAutoplay animations; gamepad navigation (both on by default)
opts.respectReducedMotionSkip screen transitions for people who ask for less motion
opts.cancelClosesOverlayEscape closes the top overlay (on by default). Your own Escape handler skips e.defaultPrevented
opts.onEvent · onScreenChange · onDataChangeCallbacks for events, screen changes and data actions
Player
goto(screen, { transition })Show a screen by name or id
push(screen) · pop() · stackOverlays, and the open screens
focusFirstButton()Start keyboard and gamepad navigation
setData(path, value) · setData(patch)Set one path, or deep-merge an object
getData(path)Read a value, or all data
play(anim) · stop(anim) · isPlaying(anim)Run the document's animations
setLocale(locale) · localesSwitch language at runtime
on(event, fn) · off(event, fn) · emit(event, payload)Listen to events ("*" for all), or send one
layout() · destroy()Rescale after a resize you manage, or unmount

The same node across runtimes

The Godot scene tree, the document and the browser's elements for The Last Hunt's main menu.

Known differences

From the format spec. All three runtimes are tested against the same documents.

Fonts

Embedded font assets work the same everywhere. For families a document does not embed, the web loads Google Fonts by name, Godot uses EnvyUI.fonts or a SystemFont, and Unity uses EnvyUI.fonts or an installed font.

Text in Unity

UI Toolkit draws text from signed distance fields, so glyphs look about 10% lighter than in Chrome at the same weight. Weights still match each other.

Rounded clipping

Godot uses clip_children when the frame has a visible fill, otherwise it clips to the rectangle.

Drop shadows

CSS blur on the web, StyleBoxFlat shadow_size in Godot (about blur × 0.6). Shapes have no shadow in Godot yet.

Group opacity

CSS flattens the group. Godot modulate multiplies each child, which shows where children overlap.

Background blur

CSS backdrop-filter on the web, a screen-texture shader in Godot that is a little softer at large radii.

Focus search

The web picks the nearest button by position; Godot uses its own search, so unusual layouts can differ. Escape closes overlays in Godot; on the web, gamepad B does.

The Godot addon, the Unity package, the web runtime and the document format are MIT licensed. They ship inside your games with no royalties. Read the license.

License

MIT, for the parts that run inside your games.

The Godot addon, the Unity package, the web runtime and the .envy.json format are free to use, copy, change and ship in any game or project, commercial or not. Each Godot export carries this text as addons/envy_ui/LICENSE, each Unity export as Packages/com.mythicbrain.envy-ui/LICENSE.md, and every copy of the web runtime starts with it as a comment. Keep them when you ship. The editor itself is sold under the EULA.

MIT License

Copyright (c) 2026 EDM doo

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.