Layout
Envy’s layout model is Godot’s. Every layer has anchors and offsets like a Godot Control, and frames can lay out their children automatically like HBoxContainer and VBoxContainer. Nothing is translated on export: the Godot runtime copies the numbers 1:1.
Anchors and offsets
Anchors are fractions of the parent rectangle, from 0 to 1, for the left, top, right and bottom edges. Offsets are pixels added to the anchored edges.
| Anchors (l, t, r, b) | Behaves like |
|---|---|
| 0, 0, 0, 0 | Pinned to the top-left corner (the default) |
| 1, 0.5, 1, 0.5 | Pinned to the right edge, centered vertically |
| 0, 1, 1, 1 | Stretches along the bottom edge |
| 0, 0, 1, 1 | Fills the parent |
On 02 Main menu in The Last Hunt · UI kit v2, the menu is anchored to the right edge and the middle, the Last save card to the bottom right, and the header and footer stretch across the top and bottom. Change the screen to 21:9 or 4:3 and each group stays where it belongs, with no second layout. You can see it on the home page.
In the inspector’s Layout section:
- Click an edge of the anchors box to pin the layer to it. With the opposite edge on too, the layer stretches. The lines in the middle center it.
- Or pick from the two lists. Horizontal anchor: Left, Right, Center, Left & right, Scale. Vertical anchor: Top, Bottom, Center, Top & bottom, Scale. Scale keeps the layer’s place and size as a share of its parent.
- Show Godot anchors & offsets shows the raw numbers: anchors from 0 to 1 on the top row, offsets in pixels below.
Auto layout
A frame or button can arrange its children in a row or a column. Shift A on a frame turns auto layout on (as a column) or off. On other layers, it wraps them in a new frame with a row.
gapbetween children,paddinginside the frame.alignon the cross axis (start, center, end) andjustifyon the main axis (start, center, end, space-between).wrapmoves children onto new lines, withlineGapbetween lines.
Children inside auto layout size themselves with Fixed, Fill or Hug on each axis: Fixed keeps the width or height you set, Fill takes the space that is left, and Hug fits the content.
In the editor, drag a child along its frame to change its place; a bar shows where it goes. Drag it outside the frame to place it freely, or hold Ctrl to drop a layer into another auto-layout frame at the bar. See Moving between frames.
| Envy | Godot | Web |
|---|---|---|
| Row / column | PanelContainer › HBoxContainer / VBoxContainer |
Flexbox |
| Wrap | HFlowContainer / VFlowContainer |
flex-wrap |
| Padding | Content margins | Padding |
| Fill | SIZE_EXPAND_FILL |
flex: 1 |
| Space-between | Expanding spacers | justify-content: space-between |
With wrap, space-between starts each line at its beginning, in every runtime, because Godot’s flow containers can’t space lines out.
Scrolling
A frame can scroll its children, for inventories, shops and leaderboards. In the inspector’s Scroll section, pick Vertical, Across or Both (None turns it off):
- Bar sets the scrollbar’s thickness, 1 to 64 px (8 by default), with its color below (white at 35% opacity by default). Hide scrollbar keeps the scrolling and hides the bar.
- The Preview sliders scroll the frame on the canvas. They aren’t saved.
- A child sized Fill along a scroll direction takes the size of its content instead.
In the game, the frame scrolls with the wheel, touch and the scrollbar, and when keyboard or gamepad focus moves to an item out of view. Godot builds a ScrollContainer.
Scaling
Every runtime scales the screen’s design resolution to fit the window and stretches the root to the window’s aspect ratio, like Godot’s canvas_items stretch mode with expand. Anchors decide how each layer follows.
Rotation
rotation turns a layer around its center in degrees. It doesn’t affect layout.
Design aids
Rulers (Shift R), guides dragged off the rulers, and layout grids (columns, rows or a square grid) help you line things up. Layers snap to guides and grid edges. Runtimes ignore all of them.
Device profiles
A device profile is a screen size plus the margins that device keeps clear: a phone’s notch, a TV’s overscan. Profiles are for the editor only. They draw guides on the canvas, set the size in Preview and drive one document check. Runtimes ignore them. A device’s real safe area still comes from the host when the game runs (see Overlays and each runtime’s safe area setting).
Six profiles are always there. Two are labeled (approximate) in the lists, because no primary source gives their numbers:
| Profile | Size | Kept clear | Numbers |
|---|---|---|---|
| Desktop 16:9 | 1920×1080 | Nothing | Standard size |
| Ultrawide 21:9 | 2560×1080 | Nothing | Standard size |
| Steam Deck 16:10 | 1280×800 | Nothing | Valve’s technical specifications |
| TV with 5% overscan | 1920×1080 | 5% of the width and height on each side | The middle 90% is the safe title area of SMPTE ST 2046-1 |
| iPhone-style notch landscape | 852×393 | 60 px left and right, 20 px bottom | Approximate: round values near what iPhones report |
| Android landscape | 800×360 | 30 px left and right, 20 px bottom | Approximate: round values, since Android devices differ |
Add your own in Settings › Project › Device profiles with Add a profile: a name, width and height (W, H), the four insets (T, R, B, L) in pixels at that size, and the overscan in percent, 0 to 25. A device keeps clear the larger of the inset and the overscan on each side. Your profiles come first in the lists, and one with the name of a built-in profile replaces it. A profile with numbers that don’t work is left out of the lists and gets a warning.
Pick the Active profile in the same place, or in the Device profile list of the View menu (pick it again to clear it). Then:
- Safe area guides in the View menu, which is off until you turn it on, draws a dashed outline on each screen, labeled “Safe area” with the profile’s name.
- In Preview, Screen size lists the profiles after Design size, then 4:3 and 9:16. A profile draws its safe area as a dashed outline, and a screen set to Keep inside the safe area lays out inside it.
- The document checks warn when a button reaches outside the safe area (
safe-area), and Document health has a Safe area row that says how many are outside, or that all buttons are inside. Envy measures every button, controls included, on every screen, in real layout at the size the screen takes on that device.
The check needs a browser’s layout, so envy validate doesn’t run it. With no active profile nothing is measured and nothing is drawn, so older files get no new warnings. The active profile is stored in the document as activeProfile, and your own profiles as profiles.
"profiles": [ { "name": "Arcade cabinet", "width": 1360, "height": 768,
"safeInsets": { "top": 0, "right": 0, "bottom": 0, "left": 0 }, "overscan": 3 } ],
"activeProfile": "Arcade cabinet"