IOS: How to set SKSpriteNode software alpha mask

I can set the alpha mask of my own custom object in the project's .sks file, but I'm not sure how to do this programmatically.

+5
source share
1 answer

UPDATE: Just figured it out.

let presetTexture = SKTexture(imageNamed: "YOURIMAGE.png") presetObject = SKSpriteNode(texture: presetTexture) presetObject.physicsBody = SKPhysicsBody(texture: presetTexture, size: presetTexture.size()) 
+4
source

Source: https://habr.com/ru/post/1269213/


All Articles