Skip to content

Build and render a UMG widget

Have an agent build a Widget Blueprint, check its layout against game-UI rules, and render it to a PNG you can look at, all without Play-In-Editor.

Before you start

Prompt

Prompt
Make a pause menu Widget Blueprint at /Game/Hayba/UI/WBP_PauseMenu: a centred vertical box with a "Paused" title and three buttons, Resume, Settings and Quit. Compile and save it, validate it for PC, fix anything the validator reports, then render it to a PNG at 2x scale and show me.

What the agent does

  1. ui_create_widget creates the Widget Blueprint with a root CanvasPanel. path is the folder and name the asset name.
  2. ui_build_tree builds the whole subtree in one call: the box, the title and the buttons with their labels. If a node fails, the widgets made before it are kept and named in the error.
  3. ui_set_slot_layout anchors and centres the box. ui_set_text_style sets fonts, sizes and colours.
  4. ui_compile_widget compiles, with save_on_success to save.
  5. ui_validate runs the rule catalogue on the real Slate layout: text overflow, room for translation, safe zones, touch target size, overlaps, contrast and gamepad focus.
  6. ui_render_widget_to_png draws the widget to a PNG under Saved/Screenshots/Hayba and returns the image inline.

Things worth knowing:

Check the result