Difference between revisions of "Lua:getPixel"

From Cheat Engine
Jump to navigation Jump to search
m (Syntax Highlighting.)
 
Line 24: Line 24:
 
===Examples===
 
===Examples===
  
<pre>
+
<syntaxhighlight lang="lua" line>
 
local color = getPixel(100, 100)
 
local color = getPixel(100, 100)
 
print(string.format("Pixel color: #%X", color))
 
print(string.format("Pixel color: #%X", color))
</pre>
+
</syntaxhighlight>
  
 
{{LuaSeeAlso}}
 
{{LuaSeeAlso}}

Latest revision as of 20:29, 25 June 2026

<> Lua API Reference

function getPixel(x, y) : integer

Returns the RGB value of the pixel at the specified screen coordinate.

Function Parameters[edit]

Parameter Type Description
x Integer The X coordinate of the screen pixel.
y Integer The Y coordinate of the screen pixel.

Returns[edit]

integer — The RGB value of the pixel at the specified screen coordinate.

Examples[edit]

1 local color = getPixel(100, 100)
2 print(string.format("Pixel color: #%X", color))

Main Pages

Core Lua documentation entry points

Lua
Script Engine