在网络上运行时,flame_tiled和/或平铺的包会出现错误

问题描述

使用flame_tiled插件加载平铺的地图。 通过TiledComponent加载地图,如下所示:

tiledComponent = TiledComponent("new4.tmx",Size(32.0,32.0));
add(tiledComponent);

这在移动设备上效果很好。但是,在将Flutter用于网络时,出现以下错误

══╡ 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

如果未添加“平铺组件”,并且仅渲染了一些Sprite,但在Sputter Web上也可以使用,但TiledComponent却没有。 有什么办法吗?还是解决方法

扑通通道beta,1.23.0-18.1。预燃0.28.0 flame_tiled 0.1.0。 平铺0.6.0

解决方法

很遗憾,该软件包不支持Web,它使用Flames SpriteBatch API,该API使用Flutters canvas.drawAtlas方法,并且该方法尚未在Web上实现。

根据您要构建的内容,您可以尝试Bonfire,它具有自己的引擎来渲染平铺地图,并且它supports web

相关问答

Selenium Web驱动程序和Java。元素在(x,y)点处不可单击。其...
Python-如何使用点“。” 访问字典成员?
Java 字符串是不可变的。到底是什么意思?
Java中的“ final”关键字如何工作?(我仍然可以修改对象。...
“loop:”在Java代码中。这是什么,为什么要编译?
java.lang.ClassNotFoundException:sun.jdbc.odbc.JdbcOdbc...