I'm subclassing SKNode
to render a map that consists of many SKSpriteNodes
by adding those nodes to my subclass.
All is working well but I noticed that the Frame
of my node subclass is always 0.
I couldn't find anything about this in the docs, so: am I supposed to override the Frame
property and return a correct value?
The frame property is the frame of the node itself, ignoring any children. For an SKNode this is a position but zero width and height.
Which I read as: SKNode draws no content so it is correct for it to be empty.
The frame of the node and its children is provided by the method calculateAccumulatedFrame() and functions that need the frame of the sub-tree should call that and not reference the frame property.
So there should be no need to override frame for your SKNode. I never have, have similar constructs in a few apps and have not yet had problems...