more stuff
This commit is contained in:
29
system-apps/dookie-clicker/startup.lua
Normal file
29
system-apps/dookie-clicker/startup.lua
Normal file
@@ -0,0 +1,29 @@
|
||||
local basalt = require("globals.basalt")
|
||||
|
||||
-- Get the main frame (your window)
|
||||
local count = 0
|
||||
local main = basalt.getMainFrame()
|
||||
main:setBackground(colors.black)
|
||||
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()
|
||||
Reference in New Issue
Block a user