My Game Sprite does not appear to be transparent with the background. Whats wrong?
How do I make it so the character sprite blends with the background?
http://i33.photobucket.com/albums/d86/warnexus/game.jpg
Very much appreciate any help given. :)
heres the code
import java.awt.*;
import java.awt.event.*;
import acm.graphics.*;
import acm.program.*;
public class blueBall extends GraphicsProgram{
public void run(){
GImage block = new GImage("block.jpg");
GImage bg = new GImage("bg.png");
GImage mario =new GImage ("mario2.png");
add(block,0,200);
add(bg);
add(mario,100,171);
}
}
Re: My Game Sprite does not appear to be transparent with the background. Whats wrong
You have not given enough information at all. I presume the sprite is from an image...does this image allow transparency (gif, png)?
Re: My Game Sprite does not appear to be transparent with the background. Whats wrong
Quote:
Originally Posted by
copeg
You have not given enough information at all. I presume the sprite is from an image...does this image allow transparency (gif, png)?
i have added the code. the sprite is basically an object of a GImage class.
Re: My Game Sprite does not appear to be transparent with the background. Whats wrong
Quote:
so the character sprite blends with the background?
Are you asking how to make the gray border around the figure in the image be transparent?
Do you have a photo editor that you could use to make those changes?
Not many of us are familiar with the classes in the acm package that you are using.
Can you convert your program to use the Java SE classes?