SKNode validation is screen and visible

Is there a way to check when SKSpriteNode/ SKNodeis on the screen (i.e. visible). I have a large scroll background where I drop mobs, but I want to limit their animation and sounds if they are not visible, Is there a way to do this, I could write something in the update loop, but I wanted to know if there is anything - Anything that I could check before I start asking for the position of the mobs in each frame?

+3
source share
1 answer

I think you are doing it wrong. You must adhere to the MVC pattern. Thus, you only have data / points that move in a large area and in the update method, if any data is in the area of ​​the screen, only you draw it. If it is missing, delete them.

0
source

All Articles