Difference between revisions of "Paintutils.drawPixel"

From ComputerCraft Wiki
Jump to: navigation, search
m (colours, not colour)
 
(6 intermediate revisions by 5 users not shown)
Line 1: Line 1:
 
{{lowercase}}
 
{{lowercase}}
 
{{Function
 
{{Function
|name=paintutils.drawPixel
+
|name=paintutils.drawPixel
|args=[[int (type)|int]] x, [[int (type)|int]] y, [[colour (API)|colour]] colour
+
|args={{type|number}} x, {{type|number}} y, {{type|number}} [[color (API)|color]]
|api=paintutils
+
|api=paintutils
|returns=nil
+
|returns=None
|addon=ComputerCraft
+
|addon=ComputerCraft
|desc=Draw a pixel on the screen
+
|desc=Draw a pixel on the screen at ''x'' and ''y'', with color ''color''. Note that the cursor will be moved and background color will be changed by this function.<br><br>
|examples=
+
 
 +
In builds prior to ComputerCraft 1.6, the color parameter is optional - if omitted, the current background color will be used instead.
 +
|examples=
 
{{Example
 
{{Example
|desc=This code will draw a red pixel at the position (10, 8)
+
|desc=Draws a red pixel at the position (10, 8).
|code=image = [[paintutils.drawPixel]](10, 8, [[colour (API)|colours]].red)
+
|code='''paintutils.drawPixel(10, 8, [[color (API)|colors]].red)'''
 
}}
 
}}
 
}}
 
}}
  
 
[[Category:API_Functions]]
 
[[Category:API_Functions]]

Latest revision as of 05:57, 28 April 2014


Grid Redstone.png  Function paintutils.drawPixel
Draw a pixel on the screen at x and y, with color color. Note that the cursor will be moved and background color will be changed by this function.

In builds prior to ComputerCraft 1.6, the color parameter is optional - if omitted, the current background color will be used instead.
Syntax paintutils.drawPixel(number x, number y, number color)
Returns None
Part of ComputerCraft
API paintutils

Examples

Grid paper.png  Example
Draws a red pixel at the position (10, 8).
Code
paintutils.drawPixel(10, 8, colors.red)