vspinnet Posted April 3, 2016 Share Posted April 3, 2016 I have a large 2D isometric game with many sprites/tiles (using a texture atlas). Normally I would write code that only renders graphics that are within the viewport with large maps. Does Phaser do this automatically? I'm not sure if I should add all my sprites at one time, or if I need to write code that adds/removes sprite that are in or not in the viewport.. Link to comment Share on other sites More sharing options...
VitaZheltyakov Posted April 3, 2016 Share Posted April 3, 2016 Large or many sprites? Link to comment Share on other sites More sharing options...
vspinnet Posted April 3, 2016 Author Share Posted April 3, 2016 48 minutes ago, VitaZheltyakov said: Large or many sprites? My tiles are 64x32 pixels. My 2D isometric maps can be up to 300x300 tiles. If the entire world is rendered with each update, I am going to add code that adds or removes sprites depending on whether or not they're in the viewport, but I don't want to bother if this is done automatically. Link to comment Share on other sites More sharing options...
michaelcalkins Posted April 3, 2016 Share Posted April 3, 2016 I don't think it is. My game's viewport is set to your window size while my map is MUCH bigger. By accident I made the viewport the same size as my world size and the performance was awful. When I reduced the viewport size, the performance went back to normal. Disclaimer: I am an experienced JS dev but new to Phaser. vspinnet 1 Link to comment Share on other sites More sharing options...
vspinnet Posted April 3, 2016 Author Share Posted April 3, 2016 Interesting. Thanks! Link to comment Share on other sites More sharing options...
VitaZheltyakov Posted April 3, 2016 Share Posted April 3, 2016 2 hours ago, vspinnet said: My tiles are 64x32 pixels. My 2D isometric maps can be up to 300x300 tiles. If the entire world is rendered with each update, I am going to add code that adds or removes sprites depending on whether or not they're in the viewport, but I don't want to bother if this is done automatically. It is 90000 tiles. This is very bad. A large number of objects in the scene leads to low productivity. I would advise to remove unwanted tiles or combine them into larger ones. vspinnet 1 Link to comment Share on other sites More sharing options...
vspinnet Posted April 3, 2016 Author Share Posted April 3, 2016 Thanks. That's what I'll do. Link to comment Share on other sites More sharing options...
Recommended Posts