phaser icon indicating copy to clipboard operation
phaser copied to clipboard

tiledmap 什么时候才能支持外部资源呢

Open woshisheji opened this issue 3 years ago • 2 comments

现在每次都提示 资源没法外置 External tilesets unsupported. Use Embed Tileset and re-export

可以如下使用吗 "orientation": "isometric", "renderorder": "left-up", "tileheight": 47, "tilesets": [ { "firstgid": 1, "source": "mapData\1011\1011_tile.json" }, { "firstgid": 1000, "source": "mapData\1011\1011_obj.json" } ], "tileversion": "1.2.2", "tilewidth": 64, "type": "map", "version": 1.2, "width": 30

//////////////// "tiles": [ { "id": 0, "image": "tile/1166_palet_00.cgp_6747.png", "imageheight": 47, "imagewidth": 64 }, { "id": 1, "image": "tile/1167_palet_00.cgp_6748.png", "imageheight": 47, "imagewidth": 64 }, { "id": 2, "image": "tile/1168_palet_00.cgp_6749.png", "imageheight": 47, "imagewidth": 64 },

woshisheji avatar Sep 05 '22 07:09 woshisheji

Hi - could you please describe the issue in English? I'm afraid I'm unable to read any other languages.

If, however, the issue is that you cannot use external tilesets - this is correct and not a bug. It's just how the tilemap system works.

photonstorm avatar Sep 05 '22 17:09 photonstorm

The map editor supports the use of external resources by objects. Phaser not support this? Will this function be updated

woshisheji avatar Sep 07 '22 03:09 woshisheji

@woshisheji You should check the “embed in map” when you new a tileset. And Phaser still unsupport to load the Image in the tiled map json. Maybe there isn't a way to load the Collection-Of-Images tileset, isn't it? is It possible to add an example for it? @photonstorm

DevenWen avatar Nov 01 '22 15:11 DevenWen

例如:

 "tilesets": [         {             "firstgid": 1,             "source": "mapData\1150\1150_tile.json"         },         {             "firstgid": 1000,             "source": "mapData\1150\1150_obj.json"         }     ],

//在引用其他Json时候内容  "margin": 0,     "name": "1150_obj",     "spacing": 0,     "tilecount": 34,     "tiledversion": "1.2.2",     "tileheight": 185,     "tiles": [         {             "id": 0,             "image": "obj/10026_palet_00.cgp_7777.png",             "imageheight": 95,             "imagewidth": 40         },         {             "id": 1,             "image": "obj/10027_palet_00.cgp_7778.png",             "imageheight": 102,             "imagewidth": 64         },         {             "id": 2,             "image": "obj/10493_palet_00.cgp_7694.png",             "imageheight": 87,             "imagewidth": 64         },         {             "id": 3,             "image": "obj/10503_palet_00.cgp_7704.png",             "imageheight": 163,             "imagewidth": 84         },

 

Www.55IDE.Com @.***

55IDE官方 开发者

 

------------------ 原始邮件 ------------------ 发件人: "Deven @.>; 发送时间: 2022年11月1日(星期二) 晚上11:51 收件人: @.>; 抄送: @.>; @.>; 主题: Re: [photonstorm/phaser] tiledmap 什么时候才能支持外部资源呢 (Issue #6209)

@woshisheji您应该在新建图块集时检查“嵌入地图”。并且 Phaser 仍然不支持在平铺地图 JSON @.***

直接回复此电子邮件,在 GitHub 上查看或取消订阅。 您收到此消息是因为您被提及。Message @.***与>

woshisheji avatar Nov 01 '22 22:11 woshisheji

function preload() {
  this.load.tilemapTiledJSON(
    "map",
    "assets/tilemaps/maps/multi-tileset-v12.json"
  );

  this.load.once(
    "filecomplete-tilemapJSON-map",
    function (key, type, data) {
      this.load.setPath("/assets/tilemaps/maps/");

      for (var tileset of data.data.tilesets) {
        this.load.image(tileset.name, tileset.image);
      }
    },
    this
  );
}

samme avatar Nov 03 '22 20:11 samme