Getting RGBA value of pixel under mouse pointer

I'm wanting to get the pixel value under the mouse pointer when its on the stage but I'm struggling to come up with a method of doing this.

Any ideas welcomed :slight_smile:

untitled script pic (2)

#ROTFLOL :slight_smile:

What a noggin I am :slight_smile:

butt....
It doesn't seem to be reporting the Alpha channel

https://snap.berkeley.edu/snap/snap.html#present:Username=cymplecy&ProjectName=kitchenSky&editMode

The region around the homes/house button has been set to alpha 254 but if I put the mouse over that region it is getting reported as 255

Using my costume inspector block shows that there is a region of 254 values

The RGBA at mouse pointer block reports the RGBA on screen, but if there's an alpha pixel on top of a non-alpha pixel, they blend, making it not transparent. I don't know why it reports the alpha channel, when, more often than not, the alpha will be 1, no matter what.

aaah - right :frowning:

I'll try another approach then to find out what pixel in the sprite the mouse is over and then directly get the pixel value out the the costume

This seems to do the job

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.