Layout Editor

Tutorial · 3:02

The Layout Editor builds the screens of a mod: menus, HUD elements, dialogs. A screen of DayZ is a .layout file, a tree of widgets (frames, panels, texts, buttons, images) that a script creates and fills. Here you edit that tree on a canvas drawn with the game's own fonts, images and styles, or you write the screen in DZML, an HTML form that compiles to the .layout. You need nothing to start: the page opens on an empty layout. With the DayZ folder set in Settings, the game's own layouts open read-only as examples, and their images and styles are shown.

The screen

First steps

  1. Open the Layout Editor. An empty layout named untitled.layout is ready, with one root frame.
  2. In the palette, click Panel: a panel is added inside the root. Drag it on the canvas and resize it by its edges.
  3. With the panel selected, click Text in the palette: the text is added inside the panel. In Properties, set its text.
  4. Give both widgets a name in Properties (F2): scripts find widgets by name.
  5. Look at the Problems tab and fix what it lists.
  6. Press F5 to see the screen without the editor's marks, Esc to come back.
  7. Click Save (Ctrl+S) and write the file inside your mod, for example MyMod/gui/layouts/my_panel.layout.

Take the tour (in the app)

Common tasks

Start a menu in DZML

  1. Click + in the tab bar and choose DZML document (HTML). A panel with a title and a Close button opens on its HTML.
  2. Edit the HTML; switch to Design to see and adjust the result.
  3. Save: the first time, you choose the name of the .html, inside your mod.
  4. Click Compile and accept the proposed .layout next to the .html. A page with row templates also gets one <page>_<row>.layout per template.
  5. In the Script tab, keep the kind "Menu" and click Write to mod: the class is written under scripts/5_Mission/<Mod>/GUI/ (the path is editable; an existing file is replaced only after you confirm).

Study a layout of the game

  1. Click Browse game layouts (the magnifier) and type a part of the name, for example inventory.
  2. Click a result: it opens read-only in a tab, with the "Game file" badge.
  3. Tick Hidden to see the widgets that scripts show at run time; use Source to read the text.
  4. To keep a modified copy, click Save: it asks where to write it. The game file is never changed.

Check a screen at several resolutions

  1. In the canvas toolbar, choose another resolution (1280 × 720, 2560 × 1440, 3840 × 2160, an ultrawide and a portrait size are listed).
  2. Watch what moves: sizes in % follow the screen, sizes in pixels do not.
  3. Choose a safe zone (95, 90 or 85 %) to see where console screens may cut the picture.
  4. Play has the same resolution selector.

Convert an existing layout to DZML

  1. Open the .layout.
  2. Click To DZML and choose where to write the .html (next to the layout by default).
  3. The new document opens. Keep the .layout out of your edits from now on: it is produced by Compile.

Reuse a group of widgets

  1. Select the widgets (Ctrl+click, or drag a rectangle on the empty area).
  2. In the Widgets tab, click the save icon of Prefabs and name it.
  3. In any document, click the prefab to insert it into the selection, or drag it onto the canvas or the hierarchy.

Generate the script of a layout

  1. Save the layout inside a mod (a folder with a $PBOPREFIX$ or a config.cpp): the editor then knows the path the game will use.
  2. Open the Script tab and choose the kind: a menu opened with ShowScriptedMenu, or a handler for a sub-panel.
  3. Copy the class, or click Write to mod, then Open in Scripts.

Examples

Concepts

Two ways of working: the .layout or DZML

A .layout becomes DZML with To DZML; a DZML page becomes a .layout with Compile. Take the DZML tour (in the app)

Notions of the game

Reference: the Bohemia Interactive community wiki (DayZ Workbench, GUI editor) and docs/FORMATS.md of this project.

Pitfalls

For agents

Tools of dzt that do the same work without the window:

Files:

What the page tells the assistant: the open file (or untitled.layout), the selected widget as name (class), the view (design, source or browser preview), the canvas resolution, whether there are unsaved edits, and the messages of the Problems tab. It proposes one action to the assistant, "Check this layout".

Anchors for tours and pointing are listed in the page's guide file (layout-palette, layout-hierarchy, layout-canvas, layout-inspector, layout-save, layout-play...).

See also