Paintutils API

From ComputerCraft
Jump to: navigation, search
FunctionFunctionpaintutils.drawBox
Draws the outline of a box on the current term from the specified start position to the specified end 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.
Syntax paintutils.drawBox()
Returns nil
Part of CC:Tweaked (source)
API paintutils
See also paintutils.drawFilledBox
ExampleExampleWith custom colour
Draws the outline of a red box from the top left corner of the current term to the bottom right corner.
Code
local width, height = term.getSize()
paintutils.drawBox(1, 1, width, height, colours.red)
Output Demo paintutils.drawBox.png


FunctionFunctionpaintutils.drawFilledBox
Draws a filled box on the current term from the specified start position to the specified end 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.
Syntax paintutils.drawFilledBox()
Returns nil
Part of CC:Tweaked (source)
API paintutils
See also paintutils.drawBox
ExampleExampleWith custom colour
Draws a filled red box from the top left corner of the current term to the bottom right corner.
Code
local width, height = term.getSize()
paintutils.drawFilledBox(1, 1, width, height, colours.red)
Output Demo paintutils.drawFilledBox.png

Paintutils.drawImage

FunctionFunctionpaintutils.drawLine
Draws a straight line on the current term from the specified start position to the specified end 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.
Syntax paintutils.drawLine()
Returns nil
Part of CC:Tweaked (source)
API paintutils
ExampleExampleWith custom colour
Draws a red line from the top left corner of the current term to the bottom right corner.
Code
local width, height = term.getSize()
paintutils.drawLine(1, 1, width, height, colours.red)
Output Demo paintutils.drawLine.png


FunctionFunctionpaintutils.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.
Syntax paintutils.drawPixel()
Returns nil
Part of CC:Tweaked (source)
API paintutils
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

Paintutils.loadImage Paintutils.parseImage