Create and manage custom user interfaces using the Poly Plaza UI Framework
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.
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:
Creating a UI instance that can be shown/hidden
Defining a data structure that describes your UI
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.
-- Create a new UI instancelocal ui = CreateUI()-- Define the UI structureui.ui = { title = "Welcome", elements = { { type = "text", content = "Welcome to Poly Plaza!" }, { type = "button", text = "Close", onClick = function() ui:Hide() end } }}-- Display the UIui:Show()
{ type = "text", content = "Hello World", -- The text to display color = "white", -- Text color (optional) size = "normal", -- Text size: small, normal, large (optional) align = "left" -- Text alignment: left, center, right (optional)}
{ type = "grid", columns = 2, -- Number of columns spacing = 5, -- Space between items (optional) elements = { -- Child elements { type = "button", text = "1" }, { type = "button", text = "2" }, { type = "button", text = "3" }, { type = "button", text = "4" } }}