Skip to main content
Poly Plaza’s UI framework combines the power of Unreal Engine’s widget system with Lua scripting, allowing you to create dynamic interfaces that seamlessly integrate with the game’s visual style.

Understanding the UI System

The UI system in Poly Plaza works by creating a bridge between Lua scripts and Unreal Engine’s widget system. When you create a UI through Lua, you’re actually:
  1. Creating a UI instance that can be shown/hidden
  2. Defining a data structure that describes your UI
  3. Letting the game engine convert that data into actual widgets
All UIs in Poly Plaza are created using the CreateUI() function and require a ui table that defines their structure.

Creating Your First UI

Here’s how to create a basic UI:

Understanding the UI Structure

Every UI in Poly Plaza requires a specific structure:
Each element in the elements array must have at least:
  • A type field specifying what kind of element it is
  • Additional fields depending on the element type

UI Element Types

Text Elements

Text elements display static or dynamic text:

Buttons

Buttons allow user interaction:

Input Fields

Input fields allow text input from users:

Images

Display images in your UI:

Layout Containers

Basic Container

Group elements together:

Grid Container

Organize elements in a grid layout:

Dynamic UIs

You can update UI content at any time by modifying the ui table:

Managing UI State

Best practices for managing UI state:

1. Single UI Instance

Keep a reference to your UI instance if you plan to reuse it:

2. Updating Content

Update specific parts of your UI when needed:

3. Cleanup

Hide UIs when they’re no longer needed:

Complete Example: Shop System

Here’s a complete example of a shop system with dynamic content:

Tips for Complex UIs

  • Create UIs once and reuse them
  • Only update parts of the UI that changed
  • Hide UIs instead of destroying them
  • Be mindful of the number of elements
  • Provide feedback for all user actions
  • Keep interfaces consistent
  • Make sure text is readable
  • Add appropriate spacing between elements
  • Use clear and concise labels
  • Split complex UIs into functions
  • Keep UI logic separate from game logic
  • Comment your code
  • Use meaningful variable names

Next Steps

Join Discord

Get help from the modding community

Youtube tutorials

Check out more examples with my video tutorials