2012-06-30 10 views

答えて

1

以前に無効にした場合はspritebatch.enableBlending()にお試しください。ただし、デフォルトで有効にする必要があります。

29

このお試しください:私はこの行 `Gdx.gl.glClear(GL20.GL_COLOR_BUFFER_BIT)との最初の画面をクリアするために必要な

  spriteBatch.begin(); 
      //background 
      seaTexture = new Texture(px); 
      Color c = spriteBatch.getColor(); 
      spriteBatch.setColor(c.r, c.g, c.b, 1f); //set alpha to 1 
      spriteBatch.draw(seaTexture, 0, 0, 480, 320); 
      //foreground 
      c = spriteBatch.getColor(); 
      spriteBatch.setColor(c.r, c.g, c.b, .3f);//set alpha to 0.3 
      spriteBatch.draw(blockTexture, 50, 100, 120, 120); 

      spriteBatch.end(); 
+0

を;' 'spriteBatch.begin()'あたりのアルファ効果を見るために前に[ここの指示](https://github.com/libgdx/libgdx/wiki/Spritebatch,-Textureregions,-Sprites) – rockhammer

+1

もちろん、これを行う必要があります。私はちょうどコードの最も重要な部分を示しました。 – Nolesh