Quantcast
Channel: Pixi.js Latest Topics
Viewing all articles
Browse latest Browse all 3978

Get the alpha of a pixel in a sprite

$
0
0

Hi everyone,

This is a bit tricky and I don't know if it is possible.

I want to get the alpha of a pixel (Which is in an x and y coordinate) of a sprite.

What I want to do is the following:
I have several textures (PNG) one on top of another as layers, what I want to do is know which layer my mouse is selecting, but since they are all one on top of the other then it cannot be done by AABB collisions. What I came up with is that I could get the mouse coordinate and go through each of the layers to find out if the alpha of that pixel is greater than 0.

Thank you.


Viewing all articles
Browse latest Browse all 3978

Trending Articles