Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- Drawing Functions
- function drawTitle(x, y, text, color_txt, color_bg, monitor)
- monitor.setBackgroundColor(color_bg)
- monitor.setTextColor(color_txt)
- monitor.setCursorPos(x,y)
- monitor.write(text)
- monitor.setCursorPos(1,1)
- monitor.setBackgroundColor(colors.black)
- end
- function drawLine(x, y, length, size, color_bar, monitor)
- for yPos = y, y+size-1 do
- monitor.setBackgroundColor(color_bar)
- monitor.setCursorPos(x, yPos)
- monitor.write(string.rep(" ", length))
- monitor.setBackgroundColor(colors.black)
- end
- end
- function drawProg(x, y, length, size, minVal, maxVal, color_bar, color_bg, monitor)
- drawLine(x, y, length, size, color_bg, monitor)
- local barSize = math.floor((minVal/maxVal)*length)
- drawLine(x, y, barSize, size, color_bar, monitor)
- end
- function drawContent(x, y, height, width, minVal, maxVal, color_bar, color_bg, monitor)
- drawGraph(x, y, height, width, color_bg, monitor)
- local a = math.floor((minVal/maxVal)*height)
- drawGraph(x, y, a, width, color_bar, monitor)
- end
- function drawGraph(x, y, height, width, color_bar, monitor)
- drawLine(x, y-height+1, width, height, color_bar, monitor)
- end
- function putTime(x,y,monitor,bool,color)
- monitor.setBackgroundColor(color)
- monitor.setCursorPos(x,y)
- time = textutils.formatTime(os.time(), bool)
- if os.time()<10.000 then monitor.write("0"..time) else monitor.write(time) end
- monitor.setBackgroundColor(colors.black)
- end
- function clearBox(x,y,h,l,monitor,color)
- monitor.setBackgroundColor(color)
- for i = y, y + h - 1 do
- monitor.setCursorPos(x,i)
- monitor.write(string.rep(" ", l))
- end
- monitor.setBackgroundColor(colors.black)
- end
- function empty(monitor)
- monitor.setBackgroundColor(colors.black)
- monitor.clear()
- monitor.setCursorPos(1,1)
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement