feat: Add dynamic layer opacity support to flame_tiled (#3843)
`flame_tiled` supported reading layer opacity from `.tmx` files at load
time, but there was no way to change a layer's opacity at runtime. This
PR adds `setLayerOpacity` and `getLayerOpacity` methods to
`RenderableTiledMap`, enabling users to dynamically adjust layer opacity
after the map has loaded.
- `RenderableLayer.opacity` is converted from a late field (computed
once at init) to a getter/setter pair. The getter returns the effective
opacity (own × parent chain); the setter stores the own opacity and
fires onOpacityChanged().
- A protected `onOpacityChanged()` hook is added to `RenderableLayer`.
`FlameTileLayer` overrides it to rebuild its cached Paint object;
`GroupLayer` overrides it to propagate the call recursively to all
children so nested tile layers stay in sync.
- `RenderableTiledMap` gains `setLayerOpacity(int layerIndex, {required
double opacity})` and `getLayerOpacity(int layerIndex)`.
- `FlameImageLayer` required no changes — it already reads opacity live
on every render() call. D
DevKage committed
b17029977b3c5890fe6794942a0553eb3f21ff8d
Parent: b8e2bab
Committed by GitHub <noreply@github.com>
on 3/5/2026, 3:20:49 PM