Skip to content

surface_get_pixel

Vašek edited this page Jan 16, 2019 · 1 revision

surface_get_pixel

Returns the color of the pixel at the position in the surface

Syntax:

surface_get_pixel(surface_id, x, y)
Argument Description
RenderTarget2D surface_id The ID of the surface to resize
int x The x position on the surface
int y The y position on the surface

Returns: Color

Description:

This function returns the color of a specific pixel from a surface, using the coordinates x, y.

Note: This function is extremely slow and may cause a pause in your game.

Example:

Color col = surface_get_pixel(surf, 128, 128);

This will return the colour of the pixel at coordinates (128,128) of the surface called surf and save it to variable col.

Back to surfaces

Clone this wiki locally