Hi, i would like to know how to get the pixels to check if it is transparent from a texture. i typecast it to a texture2d and use getpixels but i cant seem to get the pixels right. I used spritemanager btw. is it possible to use the sprite itself from spritemanager to check for transparency?
The short answer to your last question is, no, SpriteManager is just a way to combine multiple, independently moving quads into a single mesh to save draw calls (with some UV animation code thrown in). It doesn’t have any texture manipulation or information extraction features.
I’m not entirely sure what you’re wanting to know. Are you wanting to know if a given pixel (texel) in a texture has an alpha value less than 1.0? Is this for rendering purposes, or for game logic? If for rendering, then what you want is a shader that uses the alpha information the way you’re wanting. If it’s for game logic, then I think getPixels is your best bet, though I haven’t had occasion to use it and wouldn’t be the best person to advise you in its use.