Reputation: 21
I'm using a simple SKCropNode with a standard XCode Swift Game Template. Everything works fine in an emulator, but on a real iPhone 4S with iOS 8.3 I see just a green mask (although my shape is red) - no texture sprite is being displayed. The funny thing is that on iPhone 5S with iOS 9 everything works fine too. So the problem is with iPhone 4S or iOS 8.3
Here's a Screenshot of a problem I've could update my device to iOS 9, but I was thinking about supporting iOS 8 users too. Is that fixable, or is that an Apple bug?
Here's the code to reproduce, it's based on a standard SpriteKit Game Template from XCode:
let center = CGPoint(x: self.frame.width*0.5, y: self.frame.height*0.5)
let sprite = SKSpriteNode(imageNamed:"Spaceship")
sprite.position = center
let mask = SKShapeNode(rectOfSize: CGSize(width: 200, height: 200))
mask.fillColor = SKColor.redColor()
mask.position = center
let crop = SKCropNode()
crop.maskNode = mask
crop.addChild(sprite)
self.addChild(crop)
Upvotes: 2
Views: 91