1 つのことを除いて正常に動作している SKCropNode があります。黒でも白でもないマスク イメージのすべてのグレースケール値が白一色に設定されています。
これは、すべてのグレースケール アルファ値が透明度でレンダリングされているのではなく、完全に不透明に設定されていることを意味します。
これが私のコードです:
let foregroundTexture = SKTexture(image: UIImage(contentsOfFile:NSBundle.mainBundle().resourcePath!.stringByAppendingPathComponent("P01_foreground.jpg"))!)
var foreground = SKSpriteNode(texture: foregroundTexture)
let maskTexture = SKTexture(image: UIImage(contentsOfFile:NSBundle.mainBundle().resourcePath!.stringByAppendingPathComponent("P01_mask.png"))!)
var mask = SKSpriteNode(texture: maskTexture)
var cropNode = SKCropNode()
cropNode.addChild(foreground)
cropNode.maskNode = mask
cropNode.position = CGPoint(x: device.x/2, y: device.y/2)
cropNode.zPosition = 2.0
self.addChild(cropNode)
グレースケール領域が白に設定されている理由や、目的の結果を達成する方法を知っている人はいますか? 前もって感謝します!