SKEffectNode ignores children zPosition order
Originator: | sartak | ||
Number: | rdar://16534245 | Date Originated: | 2014-04-05 |
Status: | Closed | Resolved: | 2014-06-03 |
Product: | iOS SDK | Product Version: | 7.1 |
Classification: | UI | Reproducible: | Always |
Summary: SKEffectNode ignores the zPosition order of its child nodes. It seems to instead render as if zPosition were the same for each node; in other words, the SKEffectNode may be rendering its children in the order they were added. Steps to Reproduce: 1. Add an SKEffectNode to the scene. 2. Add node X with zPosition 1. 3. Add overlapping node Y with zPosition 0. Create a new iOS Xcode project (or use the attached tarball) using the Sprite Kit template. Replace the scene class's implementation with the following code. Note the if-statement inviting you to test the workaround. Expected Results: Node X should render on top of Node Y, since its zPosition is higher. Actual Results: Node Y renders on top of Node X. Possibly because Node Y was added after Node X. Version: iOS 7.1 (11D167) Notes: One workaround is to interject an ordinary SKNode. Add all the SKEffectNode's children to this SKNode, then add this SKNode to the SKEffectNode. This restores the zPosition-based drawing order. Perhaps SKEffectNode should expose a property like SKView's ignoresSiblingOrder? Configuration: iPhone 5S iOS Simulator
Comments
Please note: Reports posted here will not necessarily be seen by Apple. All problems should be submitted at bugreport.apple.com before they are posted here. Please only post information for Radars that you have filed yourself, and please do not include Apple confidential information in your posts. Thank you!
sartak
Attached a sample Xcode project to demonstrate the problem. It's also included at the bottom of this comment.
Both the
effect
andnormal
nodes have two children: red and green sprite nodes. The green sprite node has zPosition 10. The red sprite node has zPosition 5. Thus, in both cases, the green sprite node should render over the red sprite node. This is what happens with thenormal
SKNode on the lower half of the screen. However with theeffect
SKEffectNode on the upper half of the screen, the red sprite node incorrectly renders over the green sprite node.Note the if-statements on RPGMyScene.m's line 26 inviting you to test the workaround.