PNG transparency on images that aren't at z = 0.

edited November 2013 in Programming Questions

I assume this has to do with "depth sorting" but I'm not sure.

I have two images that have a random z. So sometimes one will be in front of the other. However, if the image I draw first ends up in front of the image I draw last, it won't have its appropriate transparency.

In this example, image() is called on the elephant PNG before the jack in the box one;

http://i.imgur.com/7mqE6Ra.png http://i.imgur.com/bjdshw6.png

Notice how transparency isn't working right on the elephant PNG, because its image() is called first.

What is the current solution to this issue? I read on a very old thread (couple of years) that I need to sort the images to see which one has a higher Z and display them first by order. Is that still the easiest way to do so? If so, how would I go about doing that? My images are inside a class Object each that has a Z variable to be able to access its Z.

Any help much appreciated.

Thanks.

Sign In or Register to comment.