paintutils.drawPixel

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.
ExampleWith custom colours
Draws red, green and blue pixels next to each other to the current term.
Code
<nowiki>
paintutils.drawPixel(2, 2, colours.red)
paintutils.drawPixel(3, 2, colours.green)
paintutils.drawPixel(4, 2, colours.blue)
    </nowiki>
Output

paintutils.drawPixel
Function
Syntax
paintutils.drawPixel(
  • x : number
  • y : number
  • colour? : number
)

Returns nil
API paintutils
Source CC:Tweaked (source)
This article is issued from Computercraft. The text is licensed under Creative Commons - Attribution - Sharealike. Additional terms may apply for the media files.