透明ピクセルのない背景と、透明ピクセルのあるスプライトがあります。libGDXのドキュメントに従って、私は次のようなことをしています:
spriteBatch.begin();
spriteBatch.disableBlending();
spriteBatch.draw(background, ...);
spriteBatch.enableBlending();
spriteBatch.draw(sprite, ...);
spriteBatch.end();
ただし、毎回 begin/end を使用する必要があることを示唆するこのブログ投稿を読んだところです。
http://www.rengelbert.com/tutorial.php?id=179&show_all=true
spriteBatch.disableBlending();
spriteBatch.begin();
spriteBatch.draw(backgroundRegion, 0, 0, 320, 480);
spriteBatch.end();
spriteBatch.enableBlending();
spriteBatch.begin();
spriteBatch.draw(someTextureRegion1, 10, 30);
spriteBatch.draw(someTextureRegion2, 50, 20);
spriteBatch.draw(someTextureRegion3, 30, 90);
spriteBatch.end();
これは本当に必要ですか?
私のコードは動作しているようで、エラーは報告されていませんが、2 番目の例よりもうまく動作するかどうかをテストする方法がわかりません。