I placed the node in the upper left corner of the view in my application using the following code:
health = SKSpriteNode(color: .green, size: CGSize(width: progressValue, height: 50))
health.position = CGPoint(x: -self.frame.width / 2, y: self.frame.height / 2)
This is correctly positioned in all iPhone simulators from 5 to 7 Plus.
However, it does not appear in any iPad simulator. I set the position to midX and midY, and it just didn't look with the code above, which works fine for all iPhones.
What am I missing?
Is there any other way to position nodes in the view for iPhone v iPad instead of using multiple view?
source
share