Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function drawTopBar(name)
- local title = "LINC " .. name
- term.clear()
- term.setCursorPos(1,1)
- w, h = term.getSize()
- term.setBackgroundColor(colors.lightGray)
- term.setTextColor(colors.black)
- term.clearLine()
- term.setCursorPos(math.floor((w - #title)/2), 1)
- print(title)
- term.setBackgroundColor(colors.black)
- term.setTextColor(colors.white)
- end
- function drawButton(str, bgcolor, fgcolor, keycolor)
- local bg = term.getBackgroundColor()
- local fg = term.getTextColor()
- write(" ")
- term.setBackgroundColor(bgcolor)
- term.setTextColor(fgcolor)
- term.write("[ ")
- term.setTextColor(keycolor)
- term.write(str:sub(1,1))
- term.setTextColor(fgcolor)
- term.write(str:sub(2, #str) .. " ]")
- term.setBackgroundColor(bg)
- term.setTextColor(fg)
- write(" ")
- end
- return { drawTopBar = drawTopBar, drawButton = drawButton }
Advertisement
Add Comment
Please, Sign In to add comment