I am able to set the alpha mask of my own custom object in the .sks file of the project, but I'm not sure how to do it programmatically.
UPDATE: Just figured it out.
let presetTexture = SKTexture(imageNamed: "YOURIMAGE.png")
presetObject = SKSpriteNode(texture: presetTexture)
presetObject.physicsBody = SKPhysicsBody(texture: presetTexture, size: presetTexture.size())
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With