Tag Info

New answers tagged

0

It seems you want to do some color keying, which Java cannot do on the fly with the Graphics2D library you are using. Due to this, you will need to create the alpha channel yourself, move to something that has color key support (SDL). Most engines nowadays do not support this operation as it is computationally expensive and you will need to do this "on the ...


0

You were right, Martin. The SurfaceFormat settings were off in the 2d texture. But for anyone wondering, here is a quick map how GetData/SetData works for the default GetData(data)/SetData(data): So basically your layers should be located BELOW your first picture in the 2d atlass to put them into the 3d texture seamlessly.


4

JPG is lossy. Don't use that for sprites -- you will end up with nasty artifacts that will look bad. There's a couple reasons you might want to use colur-keying, but they're a bit lost in todays hardware. Taking a quick look at color key advantages: Pros They use up less disk space -- there is no alpha channel to store By consequence, their memory foot ...


2

You could change the color of the sprite batch when it is drawing the bullet, and then back to white, like this: public void render(float delta) { batch.begin(); // some rendering worldRenderer.renderBullets(batch); // some other rendering batch.end(); } And, in renderBullets() of the world renderer you do the following: public void ...



Top 50 recent answers are included