0

I have built an animation using a CAShapeLayer (thanks to help from here)

I'm using spritekit for the app and I need to ensure that the shapelayer appears behind the nodes on the screen. Is there any way of doing this as zPosition doesn't seem to work between the nodes and the CAShapeLayer?

I've also tried building the shape as an SKShapeNode but I can't animate the bezier path when I do this.

Edit: From the link provided below I'm now trying to create two subviews. One hosting the CAShapeLayer and the other containing all the nodes. I can then position the subviews on screen. Issue I now have is that I can't add a node to a subview - getting the following error.

secondView does have a member named addChild.

(secondView is an SKView) Any ideas?

3
  • Read the section on CAShapeLayer (scroll down to the hand painted image of the cat). sartak.org/2014/03/skshapenode-you-are-dead-to-me.html
    – sangony
    May 24, 2015 at 14:36
  • Thanks for the link. So, my understanding is that I need to add a subview that contains the shapelayer behind the SKView that contains the nodes? May 24, 2015 at 15:13
  • That's what it sounds like to me but the author also seems a bit unsure about it. Trial and error is probably your best way to go right now.
    – sangony
    May 24, 2015 at 18:53

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.