I am working on a game in Xcode / Swift for iPad / iPhone.
What I need to do is get the outline path of the image / silhouette so that I can animate along the outline of the image / silhouette. This will create the effect of laser cutting, the one that you see in the films when they pierce the door / window with a laser.
Just draw it as the Beizer path will not work, since I need to do this for a bunch of images / silhouettes. If possible, I would prefer to just add images to my project and make a presentation in the code, so I can easily expand with a lot of shapes and sizes.
In SpriteKit, I tried using SKPhysicsBody, and then used Alpha to create an outline. This gives me this outline, but not as a way, so I cannot revive this line. In fact, when I turn on ".showsPhysics", I get the line I need, but still not the line that I can use for animation.
Is there a way to use / modify the ".showsPhysics" method or cancel the PhysicalBody method on the path?
I am coding in Swift and any advice would be appreciated.
This is an example of what I need, I need a blue line as a path for the animation.

source
share