openconstructor

LÖVE 2D · Lua export

Design a LÖVE 2D interface visually, export a main.lua

LÖVE has no built-in UI editor, so menus and HUDs usually start as rectangles typed out by hand. openconstructor lets you lay the screen out visually — from ready-made components or with the AI assistant — and exports a Lua file that draws the same layout in LÖVE.

Open the editor →

How it works

  1. Build the screen on the canvas from the component library or with the AI assistant.
  2. Click export ↓ and choose LÖVE 2D (Lua). openconstructor measures every visible box, border and text on the rendered page.
  3. Save the file as main.lua in an empty folder and run it with LÖVE 11.x: love path/to/folder.

What the exported file does

-- excerpt of an exported file
local nodes = {
	{k = "button", x = 64, y = 120, w = 180, h = 44, bg = {0.89, 0.34, 0.18, 1}, r = 10,
	 t = "Play", c = {1, 1, 1, 1}, fs = 16, al = "center"},
}

Making it interactive

The export is a static snapshot: nothing reacts to the mouse yet. Because every node keeps its kind, rectangle and text, adding behaviour is straightforward — for example, convert the mouse position back into design coordinates in love.mousepressed and check which "button" node contains it. You can also copy the node table into your own game state and draw it from your existing code.

Limitations

Working in Roblox instead? The Roblox UI export generates real ScreenGui instances with UICorner, UIStroke and UIGradient.

FAQ

Which LÖVE version is supported?

The exported main.lua targets LÖVE 11.x.

Does the UI resize with the window?

Yes. The design is scaled uniformly to fit the window and centred, so it keeps its proportions at any size.

Can I use custom fonts?

The export uses LÖVE’s default font. Replace love.graphics.newFont(size) in the font() helper with love.graphics.newFont("myfont.ttf", size) to use your own.

Ready to try it?

openconstructor is free, open source (MIT) and runs entirely in your browser. No sign-up is needed to build and export.

Open the editor →

More guides