使用 flame_tiled 插件加载平铺地图。通过 TiledComponent 加载地图,如下所示:
tiledComponent = TiledComponent("new4.tmx", Size(32.0,32.0));
add(tiledComponent);
这在移动设备上运行良好。但是,当使用 Flutter for Web 时出现以下错误:
══╡ EXCEPTION CAUGHT BY RENDERING LIBRARY ╞═════════════════════════════════════════════════════════
The following UnimplementedError was thrown during paint():
UnimplementedError
和
The following RenderObject was being processed when the exception was fired: GameRenderBox#0eebf:
parentData: <none> (can use size)
constraints: BoxConstraints(w=929.0, h=932.0)
size: Size(929.0, 932.0)
This RenderObject has no descendants.
════════════════════════════════════════════════════════════════════════════════════════════════════
Another exception was thrown: UnimplementedError
如果没有添加 'tiledcomponent' 并且只渲染了一些 Sprite,这些 Sprite 也适用于 Flutter Web,但不适用于 TiledComponent。有什么解决办法吗?还是解决方法?
Flutter Channel 测试版,1.23.0-18.1.pre flame 0.28.0 flame_tiled 0.1.0。平铺 0.6.0