I have 3 sprites, a background, an object, and a mask that I want to apply to the object. I want the object sprite to be drawn on top of the transparent portion of the mask, but the portion around the object is displayed as white. How do I get rid of it?
This is the render function:
@Override
public void render() {
Gdx.gl.glClearColor(1, 0, 0, 1);
Gdx.gl.glClear(GL20.GL_COLOR_BUFFER_BIT);
batch.begin();
mBackground.draw(batch);
batch.setBlendFunction(GL20.GL_ZERO, GL20.GL_SRC_COLOR);
mMask.draw(batch);
batch.setBlendFunction(GL20.GL_DST_ALPHA, GL20.GL_ONE_MINUS_DST_ALPHA);
mObject.draw(batch);
batch.end();
}