Difference between revisions of "X Media:getPixel"

From GiderosMobile
(Created page with "__NOTOC__ '''<translate>Available since</translate>:''' Gideros 2016.1<br/> '''<translate>Class</translate>:''' Media<br/> === Description === R...")
 
m (Text replacement - "<source" to "<syntaxhighlight")
 
(2 intermediate revisions by one other user not shown)
Line 1: Line 1:
 
__NOTOC__
 
__NOTOC__
 
+
'''Available since:''' Gideros 2016.1<br/>
'''<translate>Available since</translate>:''' Gideros 2016.1<br/>
+
'''Class:''' [[Media]]<br/>
'''<translate>Class</translate>:''' [[Special:MyLanguage/Media|Media]]<br/>
 
  
 
=== Description ===
 
=== Description ===
 
Returns r, g, b, a values of pixel at x,y coordinate (RGB are in range of 0 to 255, alpha is in range of 0 to 1).
 
Returns r, g, b, a values of pixel at x,y coordinate (RGB are in range of 0 to 255, alpha is in range of 0 to 1).
<source lang="lua">
+
<syntaxhighlight lang="lua">
Media:getPixel(x, y)
+
(number), (number), (number), (number) = Media:getPixel(x, y)
 
</source>
 
</source>
  
Line 14: Line 13:
 
'''y''': (number) y pixel coordinate<br/>
 
'''y''': (number) y pixel coordinate<br/>
  
<!-- {{Media}} -->
+
=== Return values ===
 +
'''Returns''' (number) red value (between 0 and 255)<br/>
 +
'''Returns''' (number) green value (between 0 and 255)<br/>
 +
'''Returns''' (number) blue value (between 0 and 255)<br/>
 +
'''Returns''' (number) alpha value (between 0 and 1)<br/>
 +
 
 +
{{Media}}

Latest revision as of 14:32, 13 July 2023

Available since: Gideros 2016.1
Class: Media

Description

Returns r, g, b, a values of pixel at x,y coordinate (RGB are in range of 0 to 255, alpha is in range of 0 to 1). <syntaxhighlight lang="lua"> (number), (number), (number), (number) = Media:getPixel(x, y) </source>

Parameters

x: (number) x pixel coordinate
y: (number) y pixel coordinate

Return values

Returns (number) red value (between 0 and 255)
Returns (number) green value (between 0 and 255)
Returns (number) blue value (between 0 and 255)
Returns (number) alpha value (between 0 and 1)