This function can be used to get the colour of a specific pixel from a surface, using the local coordinates of the surface where (0,0) is the top left corner. This function should not be used very often as it is extremely slow and may cause a pause in your game.
surface_getpixel(surface_id, x, y);
|surface_id||The ID of the surface.|
|x||The x position on the surface from which to get the pixel.|
|y||The y position on the surface from which to get the pixel.|
col = surface_getpixel(surf, 56, 78 );
This will return the colour of the pixel at coordinates (56,78) of the surface indexed in the variable "surf".