Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

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

AltStyle によって変換されたページ (->オリジナル) /