GameMaker (all)
Icon

sprite_getpixel -Optimized-

Gurpreet Singh Matharoo

You must be logged in to obtain assets

Description

sprite_getpixel() gets the color of a sprite's pixel.

• Returns the data in an array, in RGBA order.

• Values are in the 0-255 range.

• Uses buffers, which are fast!

• Automatically handles buffer creation & usage, so it only has to go through the "sprite -> surface -> buffer" process ONCE for each image, resulting in reduced processing overhead.

Usage example:

var arr = sprite_getpixel(sBoi, 0, 2, 4); // (sprite, subimg, x, y)

var color = make_color_rgb(arr[0], arr[1], arr[2]);

var alpha = arr[3]/255;

Read the documentation present inside the Scripts for usage instructions.

End User Licence Agreement (EULA).

Age Rating: 4+

Versions

GMS1 - Version 1.1.1. Published March 1, 2018

Fixed the end script

GMS2 - Version 1.1.1. Published March 1, 2018

Fixed the end script

Loading, please wait

Package contents

Loading, please wait

What is the issue?

Loading, please wait