AftGangAglay Documentation


getpix

New in 2.2.0

Parameters

Parameter Type Description
pos int[2] The screen coordinates of the pixel to read.
buf int The buffer whose contents should be read from.

Return Value

Type Description
int[3] A list of 3 ints in the range 0-255 composing the RGB color of the pixel.

Description

Retrieves the color of a screen pixel at a given coordinate in the given buffer.

Buffers

Name Description
FRONT Front buffer
BACK Back buffer
STENCIL Stencil buffer
DEPTHBUF Depth buffer

Example

import agan

class game():
	def create(self):
		return self
	#
	def update(self):
		pix = agan.getpix([ 50, 100 ], agan.BACK)
		agan.log('RGB @ (50, 100):')
		agan.log(pix[0])
		agan.log(pix[1])
		agan.log(pix[2])
	#
	def close(self):
		pass