Support dynamic changes to the layer opacity on tiled maps
Problem to solve
I would like to be able to modify the layer opacity on a tiled map.
Proposal
Being able to access a layer:
final backgroundOff = game.tileMap.getLayer("Background");
..and set its opacity:
backgroundOff.opacity = 0.5;
More information
No response
Other
- [ ] Are you interested in working on a PR for this?
Is this something that the team is working on at the moment?
It is not, would you like to be assigned to the issue?
I just tried, it already seems to work?
I just tried, it already seems to work?
final hiddenLayer = game.map.tileMap.getLayer<TileLayer>(layerToReveal);
if (hiddenLayer != null) {
hiddenLayer.opacity = 0.5;
}
}
This didn't set the opacity for me.
Maybe it only works on some types of layers then, could you add a Minimal Reproducible Example?