-
-
Notifications
You must be signed in to change notification settings - Fork 18
surface_get_pixel
Vašek edited this page Jan 16, 2019
·
1 revision
Returns the color of the pixel at the position in the surface
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
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.
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