문제

I have noticed that when using SKLabelNode there is a second unnamed node added to the node tree. This node is actually an SKSpriteNode which I am assuming is being used to display the text for the label, can anyone confirm this as I can't find any mention of this in the docs. My understanding was that SKLableNode was a single self-contained node, I was curious to find out when looking at my display graph that it appears to have brought a friend to the party.

enter image description here

도움이 되었습니까?

해결책

Yes, each label has a single SKSpriteNode child. Presumably the sprite is used to render the texture created from the label's font and text.

You won't find this mentioned in the docs as this is Sprite Kit internal behavior and subject to change.

PS: SpriteKit-Quicklook helps to find such Sprite Kit anomalies.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top