[libGDX] Make Tiled cell/tile transparent with code

I’m using a TiledMap in libGDX. Is there a way i can make a specific cell/tile transparent or set it’s opacity in libGDX? I need to make the tile transparent whenever the player steps on it or goes behind it. I don’t want to set the opacity in Tiled but in libGDX.

The Sprite class allows you to directly change the alpha amount.

I believe it is :

Sprite sprite = new Sprite() ;
sprite.setAlpha(someValue) ;

I guess the cell is a texture. Any way i can change the alpha of a texture?

You could use a simple shader, as that is basically what the sprite alpha and color altering methods are doing.

It would not take long to switch over to Sprite as opposed to texture, it’s going to be easier and faster than doing it yourself.