Spawn a window at runtime
Spawn a draggable window from game logic instead of placing it in the designer hierarchy.
Example — open settings from a button
Section titled “Example — open settings from a button”flowchart LR Btn[Settings button clicked] --> Create[Create Draggable Window] Create --> Add[Optional: Add Content Widget] Add --> VP[Add to viewport]
Blueprint wiring
Section titled “Blueprint wiring”- On button On Clicked, call Create Draggable Window (Child Widget Class).
- Set Window Class to your WBP_DraggableWindow (or subclass).
- Set Child Widget Class to the panel you want inside the frame (e.g. settings UI).
- Tune Start Size (
640×480is a good default), Center To Screen =true. - Add the returned widget to the viewport (or parent under your HUD root).
Preset parameters
Section titled “Preset parameters”| Use case | Start Size | Can Resize | Startup State |
|---|---|---|---|
| Modal dialog | 480×320 | false | Default |
| Full app window | 960×640 | true | Default |
| Tray-style launcher | 320×240 | true | Start Minimized |
Close handling
Section titled “Close handling”Bind On Close Window on your window subclass to play UI sound or refresh HUD state. Call Close Window from a title-bar close button.
// C++ equivalent (minimal)UDraggableWindow* Window = UDraggableWindow::CreateDraggableWindow( this, WindowClass, ChildClass, FVector2D(640.f, 480.f));if (Window) { Window->AddToViewport(); }Troubleshooting
Section titled “Troubleshooting”| Issue | Fix |
|---|---|
| Window does not drag | Enable Drag = true; WindowTitleBorderWidget bound |
| Cannot resize | Enable Resizing = true; ResizeAreaWidget bound with Is Variable |
| Child empty | Pass Child Widget Class or call Add Content Widget after create |