Closed AbyssOfMisery closed 6 years ago
create:function(){
this.map=this.game.add.tilemap('map1');
this.map.addTilesetImage('tiles');
this.layer = this.map.createLayer('floor');
this.layer.resizeWorld();
Hi, Are you looking for how this function works or are you reporting a bug in it ? https://phaser.io/docs/2.4.4/Phaser.TilemapLayer.html#resizeWorld
If there's no layer named 'floor', the result of createLayer() will be undefined.
Check the browser console for warnings.
Find the layer names in this.map.layers
.
thanks, i have find it out. it's not phaser's problem, its Tiled editor problem, I set zilb compression on.
Uncaught TypeError: Cannot read property 'resizeWorld' of undefined at Game.Level1.create (Level1.js:16) at i.StateManager.loadComplete (phaser.min.js:3) at i.StateManager.preUpdate (phaser.min.js:3) at i.Game.updateLogic (phaser.min.js:3) at i.Game.update (phaser.min.js:3) at i.RequestAnimationFrame.updateRAF (phaser.min.js:3) at window.requestAnimationFrame.forceSetTimeOut._onLoop (phaser.min.js:3)