Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- w, h = term.getSize()
- --Text Formatters--
- function leftAlign(string, h, txtcol, backcol)
- term.setCursorPos(1, h)
- if txtcol then
- term.setTextColor(txtcol)
- end
- if backcol then
- term.setBackgroundColor(backcol)
- end
- term.write(string)
- end
- function centerAlign(string, h, txtcol, backcol)
- term.setCursorPos(w / 2 - #string / 2 + 1, h)
- if txtcol then
- term.setTextColor(txtcol)
- end
- if backcol then
- term.setBackgroundColor(backcol)
- end
- term.write(string)
- end
- function rightAlign(string, h, txtcol, backcol)
- term.setCursorPos(w - #string + 1)
- if txtcol then
- term.setTextColor(txtcol)
- end
- if backcol then
- term.setBackgroundColor(backcol)
- end
- term.write(string)
- end
- function resetText()
- term.setBackgroundColor(colors.black)
- term.setTextColor(colors.white)
- end
- --Easier Colors API--
- colors = {}
- for i = 0, 15 do
- colors[i + 1] = 2 ^ i
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement