Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local x,y = term.getSize()
- local startMenu = false
- function clickStart()
- if startMenu == true then
- startMenu = false
- else
- startMenu = true
- end
- drawGUI()
- end
- local drawingBoard = {
- ["A"] = colors.white,
- ["B"] = colors.orange,
- ["C"] = colors.magenta,
- ["D"] = colors.lightBlue,
- ["E"] = colors.yellow,
- ["F"] = colors.lime,
- ["G"] = colors.pink,
- ["H"] = colors.gray,
- ["I"] = colors.lightGray,
- ["J"] = colors.cyan,
- ["K"] = colors.purple,
- ["L"] = colors.blue,
- ["M"] = colors.brown,
- ["N"] = colors.green,
- ["O"] = colors.red,
- ["P"] = colors.black,
- }
- local startMenuObjects = {
- [8] = "Programs >",
- [7] = "Documents >",
- [6] = "Settings >",
- [5] = "Find >",
- [4] = "Help",
- [3] = "Run...",
- [1] = "Shut Down...",
- }
- function pixelatedDrawing( pos1, pos2, str )
- for i=1,#str do
- term.setCursorPos( pos1 + (i-1) , pos2 )
- term.setBackgroundColour( drawingBoard[ string.sub( str, i, i) ] )
- write(" ")
- end
- end
- function drawGUI()
- term.setBackgroundColour( colors.cyan )
- term.clear()
- term.setCursorPos(1,y)
- term.setBackgroundColour( colors.lightGray )
- term.clearLine()
- term.setBackgroundColour( colors.gray )
- term.setTextColour( colors.black )
- write("Start")
- if startMenu then
- for i=y-8,y-1 do
- if i == y-2 then
- pixelatedDrawing(1,i,"HHHHHHHHHHHHH") --Hi :D
- else
- pixelatedDrawing(1,i,"HIIIIIIIIIIII") --Hi :D
- local theValue = ((i-y)*-1)
- term.setCursorPos(2, i)
- write( startMenuObjects[ theValue ] )
- end
- end
- end
- end
- function wasBetween( xz, x1, y1, vr1, vr2 )
- if xz > x1 and xz < y1 and vr1 == vr2 then
- return true
- end
- return false
- end
- drawGUI()
- while true do
- local event, key, xz, yz = os.pullEvent()
- if event == "mouse_click" then
- if key == 1 then
- if wasBetween(xz, 0, 6, yz, y) then
- clickStart()
- elseif wasBetween(xz, 2, 14, yz, y-1) then
- os.shutdown()
- end
- elseif key == 2 then
- dropdown()
- end
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment