Files
ccphone/system-apps/dookie-clicker/startup.lua
2025-12-23 12:46:47 -08:00

29 lines
598 B
Lua

local basalt = require("globals.basalt")
-- Get the main frame (your window)
local count = 0
local main = basalt.getMainFrame()
main:setBackground(colors.gray)
local w,h = term.getSize()
main:addLabel({
x = w/2-(7/2)+1,
y = 2,
text = "Welcome!",
foreground = colors.yellow
})
local countLabel = main:addLabel({
x = w/2-(7/2)+1,
y = 5,
text = "0",
foreground = colors.white
})
local button = main:addButton({
x = w/2-(7/2)+1,
y = 10,
text = "Click Me!",
foreground = colors.white
}):center():onClick(function () count = count + 1 countLabel:setText(tostring(count)) end)
basalt.run()