Problem with bitmask transparency

Hi

Sometimes in my game my sprites’ transparency do not show correctly; they are opague on a black background. To make this worse, sometimes it happens, usually it doesn’t. I’d run the program, and it wouldn’t work and then if I run it again, it works just fine. Any ideas? I’m loading the images from disk using Toolkit.getDefaultToolkit().createImage(), then MediaTracker’ing them, then creating a compatible image with bitmask transparency with my graphics configuration and drawing the original onto it with a Graphics2D. I’m using fullscreen with GraphicsDevice.setFullScreenWindow and the display mode is 640x480x8. Drawing to the screen is with BufferStrategy.Did i miss anything important? Any help would really be appreciated.

Im using java 1.4.2_04

Thanks…

You might try using ImageIO.read() instead of the Toolkit+MediaTracker stuff (assuming of course you’re happy to use a 1.4VM)

Kev

I would 1st point the finger at fullscreen 8bit (coupled with BufferStrategy)
It is quite possible there are still bugs in 8bit mode. (as it hasn’t been as extensively tested as 16/32bit modes)

Try using 16bit/32bit, and see if it renders correctly.
if there is no problem - then you know the cause (or atleast how to avoid it ;P)
Formulating a solution maybe alot more problematic (and will undoubtable require a bug report)