Full Export
Full Export produces a complete, ready‑to‑run program. It contains everything: the UI rendering engine, every screen's layout, your block logic, and the interactive event loop that ties them together. This is the mode you want when you simply want to drop the project into the game and run it.
In the export window this is the Full Export option: "UI rendering + block logic + event loop. Ready to run."
What gets written
Full Export writes the complete folder — components/, screens/, logic/, utils/,
and startup.lua. Each file is described in the
Generated File Reference, and utils/functions.lua here includes
the full UI runtime (drawScreens, navigate, getScreen, …).
What makes it "Full": the event loop
In Full Export, startup.lua ends with the main event loop. After loading everything,
it continuously pulls CC: Tweaked events and dispatches them to the active screen and its
components — clicks, drags, key presses, monitor touches, timers, redstone, and modem
messages:
while running do
if lastEvent ~= "timer" then
drawScreens()
end
local event, p1, p2, p3, p4, p5 = os.pullEvent()
local isMonitor = event == "monitor_touch"
local screen = getScreen(isMonitor and 'monitor:' .. p1 or 'terminal')
-- … dispatch the event to the screen's components and event handlers …
end
This is what makes a Full export interactive. Buttons respond to clicks, inputs accept
typing, sliders drag, timers fire, and navigate(...) can switch screens — all without
you writing a line of Lua.
Example: a screen + its logic
A screen file builds the UI tree. Each element is created with its resolved position, size, colors, and properties, then added to the screen:
local screen = Screen:new("Screen_1", {
bgColor = colors.black,
isWorkingScreen = false, displayType = "any",
monitorsHeightSize = 19, monitorsWidthSize = 29,
monitorsHeightUnit = "=", monitorsWidthUnit = "=",
})
screen:addChild(Button:new("button1", {
x = 12, y = 4, width = 20, height = 3,
type = "button",
text = "Click me",
textAlign = "center",
bgColor = colors.gray, textColor = colors.white,
focusBgColor = colors.lightGray, focusTextColor = colors.white,
screenName = "Screen_1",
}))
screen:addDrawOrder("button1")
table.insert(screens, screen)
The matching logic file looks up that screen and attaches your blocks as handlers:
local screen = getScreen("Screen_1")
screen:getChild("button1").events["released"] = function()
navigate(screen.name, "Screen_2")
end
screen.events.onceLoaded = function()
screen:childSetProp("label1", "text", "Hello World!")
end
💡 Tip: The events you can react to —
released,value_changed,onceLoaded, timers, redstone, modems, and more — and the screen/element objects they attach to are documented in the Runtime API.
Running it
- Export with Full Export (optionally tick Minify or All‑In‑One).
- Place the exported folder in a computer's directory in CC: Tweaked / CraftOS‑PC.
- Run
startup.lua— or just reboot the computer, since CC: Tweaked runsstartupautomatically.
See also
- UI Only Export — same UI, but you write the logic
- Logic Only Export — logic without any UI
- Generated File Reference — the folder tree and every file
- Runtime API