devx123x Posted November 25, 2016 Share Posted November 25, 2016 I have a tilemap with two layers. How can I make sure only the tiles that are visible are being rendered? If a tile on the first layer is covered completely by a tile of the second layer, I don't want to render it. But some tiles on the second layer do not completely cover the tile below them. Anyone have some code samples? Link to comment Share on other sites More sharing options...
CharlesCraft50 Posted November 26, 2016 Share Posted November 26, 2016 I use multiple layers to do that, All you need to do is just hide it using layer1.visible = false; My code: if(player.body.x > 5500 && player.body.y < 6720) { world_Map_2_layer.visible = true; if(player.body.x > 6900) { world_Map_1_layer.visible = false; } } if(player.body.x < 6900) { world_Map_1_layer.visible = true; if(player.body.x < 5650) { world_Map_2_layer.visible = false; } } Link to comment Share on other sites More sharing options...
Recommended Posts