[]加载资源时同时加载两遍
你把你的“hero_03.png”这个文件放到atlas下,把url改成
hero.graphics.drawTexture(Laya.loader.getRes("res/atlas/role/hero_03.png"));
hero.graphics.drawTexture(Laya.loader.getRes("res/atlas/role/hero_03.png"));
人物的图片也没有显示出来
我把我改过的Demo发给你,你运行一下看看,到底是哪里不对,我不知到你的具体需求,你描述的太笼统了
在ide调试下,tiledmap会调用两次,所以会出现错误,这是个bug,我们帮你改了一下,你把这个代码替换一下就好了
if(hero == null)
{
this.tiledmap.name = "xx00";
var viewRect = new Rectangle(0,0,1080,1100);
this.tiledmap.createMap("../laya/assets/map/beitianting.json",viewRect,Handler.create(this,onMapCreated));
}
if(hero == null)
{
this.tiledmap.name = "xx00";
var viewRect = new Rectangle(0,0,1080,1100);
this.tiledmap.createMap("../laya/assets/map/beitianting.json",viewRect,Handler.create(this,onMapCreated));
}
要回复问题请先登录