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
- Hayba is installed and your agent is connected. See Getting started.
- You are in a scratch project, ideally under source control.
- Review each external edit is off. This guide creates assets, which the exact review cannot approve on this version. See What can be approved.
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
ui_create_widgetcreates the Widget Blueprint with a root CanvasPanel.pathis the folder andnamethe asset name.ui_build_treebuilds 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.ui_set_slot_layoutanchors and centres the box.ui_set_text_stylesets fonts, sizes and colours.ui_compile_widgetcompiles, withsave_on_successto save.ui_validateruns the rule catalogue on the real Slate layout: text overflow, room for translation, safe zones, touch target size, overlaps, contrast and gamepad focus.ui_render_widget_to_pngdraws the widget to a PNG underSaved/and returns the image inline.Screenshots/ Hayba
Things worth knowing:
- Rendering needs no Play session. If
coverage_percentis 0, the widget drew nothing; compile it first. ui_layout_snapshotgives the measured geometry the validator judges, when you want numbers instead of a picture.- To make a button do something, expose it with
ui_set_variable, compile, then bind its click withui_bind_event. ui_set_widget_propertiesstays out of the undo stack on purpose. The typed tools above are the better choice for common changes.- For fonts, pass a composite Font asset, not a Font Face. Unreal draws a raw Font Face as glyph tiles.
Check the result
- Look at the PNG the agent returns. Ask it to render again after each fix.
- Ask for the validator's findings by rule, and which it fixed.
- Open
WBP_PauseMenuin the UMG designer.