This is a read-only snapshot of the ComputerCraft forums, taken in April 2020.
LikeableBump's profile picture

[LUA] Setting the Background Color on Advanced Monitors

Started by LikeableBump, 22 January 2013 - 09:10 AM
LikeableBump #1
Posted 22 January 2013 - 10:10 AM
I made this function to print a pixel on a monitor, and after I print a pixel, it sets the background color of all the text on the screen. Here's the function; the monitor was wrapped farther up the list. There is some other text being written to the monitor farther down in the code, and that is being affected by this function. I basically need to know how to "unset" the background color after I run the function, or set it to be clear. I did look around on the advanced monitor wiki page and the color api page but couldn't find anything. Thanks for the help!


local function printPixel(color, xPos, yPos)
  m.setBackgroundColor(color)
  m.setCursorPos(xPos, yPos)
  m.write(" ")
end
ikke009 #2
Posted 22 January 2013 - 10:35 AM
Just do term.setBackgroundColour(colours.black) or whatever colour you use as a background after you printed the pixel.
LikeableBump #3
Posted 22 January 2013 - 10:59 AM
Just do term.setBackgroundColour(colours.black) or whatever colour you use as a background after you printed the pixel.

Wooow I feel dumb. Thanks!