0

I have been searching for a way to to take my paths (in blue below) and get a CGPathRef from them, there would be 3/6 paths created per tile. I heard something about using an Alpha but I was unsure because all references were about creating a polygon and not a path.

In the end you will have sprites that followPath per tile point they land on.

enter image description here

HexBlit
  • 1,172
  • 1
  • 13
  • 31
  • Why don't you just use the images and SKSpriteNode when you already have them? It's going to be faster as well because SKShapeNode can not be drawn in batches like sprites (using the same texture/atlas). – CodeSmile Apr 29 '14 at 18:24
  • I am drawing a path because another SKSpriteNode will be following the blue lines, using the followpath: withDuration: method there are multiple tiles drawn that when put down the player's sprite follows that path outlined on the tile. https://developer.apple.com/library/ios/documentation/SpriteKit/Reference/SKAction_Ref/Reference/Reference.html#jumpTo_17 – HexBlit Apr 29 '14 at 19:00
  • I haven't been able to come up with a way to do this (though I agree, it should be possible), but there's an excellent tool over at http://dazchong.com/spritekit/ that will spit out the code if you manually trace your images, which is faster than trial and error, at least. – webbcode Apr 29 '14 at 21:03
  • yeah i saw that, it creates the path and generates a shape, but it also means you do that for retina versus non-retina. I was able to manually add points based on sprite position that works for both retina. Well perhaps later I will build an OpenSource library to do this. Was hoping someone found a way and I didnt want to reinvent the wheel. – HexBlit Apr 29 '14 at 21:06
  • @LearnCocos2D - Didn't you answer similar question like this already? http://stackoverflow.com/questions/19256555/is-there-a-way-to-create-a-cgpath-matching-outline-of-a-skspritenode – sangony Apr 29 '14 at 23:49

0 Answers0