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?

Community
  • 1
  • 1
user1759949
  • 189
  • 1
  • 3
  • 11
  • Read the section on CAShapeLayer (scroll down to the hand painted image of the cat). http://sartak.org/2014/03/skshapenode-you-are-dead-to-me.html – sangony May 24 '15 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? – user1759949 May 24 '15 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 '15 at 18:53

0 Answers0