Phaser: Light2D not working for DynamicTilempas

Created on 11 Apr 2018  路  5Comments  路  Source: photonstorm/phaser

The Light2D pipeline works fine with Sprites, anyway I'm not able to get it working with a Tiled generated background which is a DynamicTilemapLayer

馃挅 Feature Request Complex Low

Most helpful comment

Yes, it was never meant to work with tilemaps, which is why I鈥檝e marked this as a long term feature request.

All 5 comments

Here the error message I get
bug
bug

Yes, it was never meant to work with tilemaps, which is why I鈥檝e marked this as a long term feature request.

preload(){                                                                            
    this.load.image('tile-normals', tileNormals);                                                                   
    this.load.image('tile-background', tilePurple);                                                              
    this.load.tilemapTiledJSON('map', level);  
}
 create(){              
    const tilesBackground = this.map.addTilesetImage(                                                            
      'tileset-image-name-in-tiledjson',                                                                            
      'tile-background'                                                                                          
    );                                                                                                           

    this.layerBackground = this.map.createDynamicLayer('background-1', tilesBackground, 0, 0);             

    const tex = this.textures.get('tile-background');                                                            
    tex.setDataSource(this.textures.get('tile-normals').getSourceImage());                                       
    this.layerBackground.texture = tex;          

    this.layerBackground.setPipeline('Light2D');          
}

Actually works, but only for dynamicLayers.
Also it's hacky.

If you do it with staticLayers... it's... umm... interesting.

Ok, Dynamic Tilemap Layers now support normal maps properly. However, Static Layers do not (and will remain this way for the foreseeable future)

Thank you for submitting this feature request. We have implemented this and the feature has been pushed to the master branch. It will be part of the next release. If you get time to build and test it for yourself we would appreciate that.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

halilcakar picture halilcakar  路  4Comments

samme picture samme  路  4Comments

lilijreey picture lilijreey  路  4Comments

rexrainbow picture rexrainbow  路  4Comments

Legomite picture Legomite  路  4Comments