Oyed Posted June 18, 2017 Share Posted June 18, 2017 After realising Phaser.TilemapLayer is rendered individually in Game.world, I thought a good idea in order to have certain Game objects render above the Sprites was to have them inserted using addChildAt on Game.world so that they'd be rendered before the last Layer in the Tilemap. All Entities/Players in my Game were already handled by a single Phaser.Group so all I had to do was change how I created this Group: const group = new Phaser.Group(Game); Game.world.addChildAt(group, (Game.world.children.length - 2)); this._group = group; And it works. However, there is an issue. The Phaser.TilemapLayer that is being rendered over the Phaser.Group containing the Phaser.Sprite objects, it has Anti-aliasing applied to it. For example:Before:After: Is there anything I'm doing wrong? Thanks. Link to comment Share on other sites More sharing options...
Oyed Posted June 19, 2017 Author Share Posted June 19, 2017 Bump Link to comment Share on other sites More sharing options...
bhudson91 Posted June 19, 2017 Share Posted June 19, 2017 I may not fully understand the problem, but tell me if im close. You have a sprite and you want him to appear behind certain layers. For example, a player walking behind a tree. You want him to appear above the grass but behind the tree so there is some level of depth. I went about this in a different manner by doing the following: //Add Grass layer map.createLayer('Background'); //LOAD THE PLAYER player = game.add.sprite(800, 400, 'dude'); game.physics.enable(player, Phaser.Physics.ARCADE); player.body.collideWorldBounds = true; player.bringToTop(); // add other layers map.createLayer('Foreground'); map.createLayer('Treetop'); This makes it so my sprite appears on the appropriate layer and has the depth that i desire. I may have missed your point completely though. Link to comment Share on other sites More sharing options...
Recommended Posts