paintutils.drawPixel

From ComputerCraft
Jump to: navigation, search

paintutils.drawPixel
Function
Syntax
paintutils.drawPixel()
Returns nil
API paintutils
Source CC:Tweaked (source)

Draws a single pixel to the current term at the specified position. Accepts an optional colour argument, which defaults to the term's current background colour.

This function does not restore the original cursor position after being called. You may have to manually set it back with the term.setCursorPos function.
This function does not restore the original background colour after being called. You may have to manually set it back with the term.setBackgroundColour function.
ExampleExampleWith custom colours
Draws red, green and blue pixels next to each other to the current term.
Code
paintutils.drawPixel(2, 2, colours.red)
paintutils.drawPixel(3, 2, colours.green)
paintutils.drawPixel(4, 2, colours.blue)
Output Demo paintutils.drawPixel.png