SFML community forums
Help => Graphics => Topic started by: ShadowDancer on October 24, 2009, 04:52:19 pm
-
What will be color of masked image?
I have image as button, and i want to decect when user click, but image have some masked parts. I tried with GetPixel, but it return hmm impossible values(at start it's 3,0,3,0. and r and b values increasing over time). Anyway to solve it?
-
A transparent pixel will have its alpha value to 0 (for complete transparency).
bool inside = sprite.GetPixel(x, y).a > 0;
-
Ach, true. I switched 0 as full visible and 255 as no visible.