Skip to main content

UI Only Export

UI Only Export is like a Full Export without the logic. It ships the complete rendering engine and every screen layout, draws them once, and then stops — there is no event loop and no logic/ folder. It's the right choice when you love the visual design you built in CCraft Studio but want to write your own Lua behavior on top of it.

In the export window this is the UI Only option: "Just screen drawing functions. Code your own logic."

What's different from Full

It writes the same folder as Full minus the logic/ folder, and startup.lua ends differently. See the Generated File Reference for the shared layout.

Full ExportUI Only Export
components/ · screens/
utils/functions.lua (UI runtime)
logic/❌ removed
End of startup.luainteractive event loopdrawScreens() only

What "UI Only" means at runtime

Instead of the main event loop, startup.lua ends with a single call:

-- Project Start
drawScreens()

That renders every working screen to its display once and the program ends. Nothing is interactive yet — there are no click handlers, no timers, and no key handling — because all of that lived in the logic you chose to leave out.

Adding your own logic

Because the full runtime API is present, you can add behavior with plain Lua. For example, append your own event loop to startup.lua (or a new file you dofile), using the same helpers the Full export would have used:

-- Look up a screen and one of its elements
local screen = getScreen("terminal") -- the screen on the computer's terminal
local btn = screen:getChild("button1")

-- React to clicks yourself
btn.events["released"] = function()
screen:childSetProp("label1", "text", "Clicked!")
end

-- A minimal hand-written loop
while true do
drawScreens()
local event, p1, p2, p3 = os.pullEvent()
if event == "mouse_click" then
local hit = screen:getTopTouchedElement(p2, p3)
if hit and hit.onClickEvent then hit:onClickEvent(p2, p3) end
end
end

The functions you have available — getScreen, drawScreens, navigate, screen:getChild, screen:childSetProp, and the component events tables — are all described in the Runtime API.

💡 Tip: If you find yourself re‑implementing the event loop from scratch, you probably want a Full Export instead and just edit the generated logic/ files.

Running it

  1. Export with UI Only.
  2. Place the folder in a computer's directory.
  3. Run startup.lua — you'll see the UI rendered. Add your own Lua to make it do something.

See also