Sign in to follow this  
mariogarranz

Does Phaser handle object visibility according to camera?

Recommended Posts

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?

Share this post


Link to post
Share on other sites

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.

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
Sign in to follow this  

  • Recently Browsing   0 members

    No registered users viewing this page.