I am trying to clear out the drawn texture from the screen.
Lets take a classic game example - in many games when the character goes through the coins the coins clears out from the screen and displays a sweet animation like fade in and fade out the points collected from that coin(+10) and show the coin exploding animation on that position.
I want to do something similar to that.
I am using
SpriteBatch to draw the texture region like below.
Setting texture Region:
(...) public Texture texture; public TextureRegion coin; texture = new Texture(Gdx.files.internal("data/texture.png")); texture.setFilter(TextureFilter.Nearest, TextureFilter.Nearest); coin = new TextureRegion(texture, 0, 336, 65, 73); (...)
Drawing the texture into screen :
public SpriteBatch batcher; batcher = new SpriteBatch(); batcher.setProjectionMatrix(cam.combined); batcher.begin(); batcher.enableBlending(); batcher.draw(coin, x, y, 65,73); (...) (...) batcher.end();
The game character is also drawn using the same logic shown above.
Now when the game character will collide with the coin that I have drawn,the coin must be cleared(vanished) and some animation or big font like +50 must fadein and fadeout in that position.I tried but didn't find anything that would do this.
So how to do that ?