Sprite Kit: number of SKSpriteNodes on screen

This seems like a very simple question, but I cannot find the answer anywhere. I am making a game using the Sprite Kit, and I would like to count the number of SKNodes that I am currently on the screen. I can see the account in the lower right corner in my debugging information, but I'm not sure how to access it as an integer that I can use for programming. Any suggestions?

+4
source share
1 answer

Apple docs say: "The SKScene object represents the content scene in the sprite set. The scene is the root of the node in the Sprite Kit node tree ..."

, SKScene, , .

NSLog(@"%lu", (unsigned long)[self.children count]);
+5

Source: https://habr.com/ru/post/1537414/


All Articles