【发布时间】:2018-04-09 16:55:09
【问题描述】:
如何为 libgdx java 改编这段 c# 代码?
SpriteBatch.Begin(SpriteSortMode.Texture, maxBlend);
private static readonly BlendState maxBlend = new BlendState() {
AlphaBlendFunction = BlendFunction.Max,
ColorBlendFunction = BlendFunction.Max,
AlphaDestinationBlend = Blend.One,
AlphaSourceBlend = Blend.One,
ColorDestinationBlend = Blend.One,
ColorSourceBlend = Blend.One
};
我在那里找到了它: article
试过这段代码,但它不能正常工作:
batch.setBlendFunction(GL20.GL_SRC_ALPHA, GL20.GL_ONE);
batch.setBlendFunction(GL20.GL_SRC_COLOR, GL20.GL_ONE);
还有这个:
Gdx.gl.glEnable(Gdx.gl20.GL_BLEND);
Gdx.gl.glBlendFunc(Gdx.gl20.GL_ONE, Gdx.gl20.GL_ONE);
Gdx.gl.glEnable(Gdx.gl20.GL_BLEND_COLOR);
Gdx.gl.glBlendFunc(Gdx.gl20.GL_ONE, Gdx.gl20.GL_ONE);
怎么做?
【问题讨论】: