mariogarranz Posted September 2, 2014 Share Posted September 2, 2014 I've been checking the source code and I could not find anything, so I'm wondering, is it necessary for the developer to make calculations on which elements are currently inside the camera view, and which are not, in order to change their "visible" property and improve rendering performance, or does Phaser already handle that? Link to comment Share on other sites More sharing options...
lewster32 Posted September 2, 2014 Share Posted September 2, 2014 The Sprite.inCamera property will tell you if a sprite is visible or not, but beware that each time it's checked, the sprite's bounds are recalculated - you'll have to determine how expensive this operation is compared to allowing the sprites to be rendered outside of your camera bounds. mariogarranz 1 Link to comment Share on other sites More sharing options...
mariogarranz Posted September 2, 2014 Author Share Posted September 2, 2014 That's great! It will let me decide which elements I want to check and which not easily.Thanks a lot lewster, you are always really helpful! Link to comment Share on other sites More sharing options...
Recommended Posts