Difference between revisions of "Lua:getPixel"

From Cheat Engine
Jump to navigation Jump to search
(Created page with ''''function''' getPixel(''x'', ''y'') Returns the RGB value of the provided pixel in screen coordinates ===Function Parameters=== {|width="85%" cellpadding="10%" cellpadding="5…')
 
m (Syntax Highlighting.)
 
(4 intermediate revisions by 2 users not shown)
Line 1: Line 1:
'''function''' getPixel(''x'', ''y'')
+
[[Category:Lua]]
 +
{{CodeBox|'''function''' getPixel(''x'', ''y'') ''':''' integer}}
  
Returns the RGB value of the provided pixel in screen coordinates
+
Returns the RGB value of the pixel at the specified screen coordinate.
  
 
===Function Parameters===
 
===Function Parameters===
{|width="85%" cellpadding="10%" cellpadding="5%" cellspacing="0" border="0"
+
{|width="85%" cellpadding="10%" cellspacing="0" border="0"
 
!align="left"|Parameter
 
!align="left"|Parameter
 
!align="left"|Type
 
!align="left"|Type
Line 11: Line 12:
 
|x
 
|x
 
|Integer
 
|Integer
|The x coordinate to get the pixel of
+
|The X coordinate of the screen pixel.
 
|-
 
|-
 
|y
 
|y
 
|Integer
 
|Integer
|The y coordinate to get the pixel of
+
|The Y coordinate of the screen pixel.
 
|}
 
|}
  
 +
===Returns===
 +
integer — The RGB value of the pixel at the specified screen coordinate.
  
== See also ==
+
===Examples===
* [[Lua]]
+
 
 +
<syntaxhighlight lang="lua" line>
 +
local color = getPixel(100, 100)
 +
print(string.format("Pixel color: #%X", color))
 +
</syntaxhighlight>
 +
 
 +
{{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