Reputation: 4887
I created a new game project using swift in xcode 6. I added a rectangle to the game scene like so,
let leftBoundRect = SKSpriteNode(color: UIColor.blackColor(), size: CGSize(width: self.size.width/2, height: self.size.height))
leftBoundRect.position = self.anchorpoint
self.addChild(leftBoundRect)
I also changed the display orientation from protrait to landscape by unchecking the portrait setting, so it displays in widescreen now.
So basically the rectangle is displayed, but it starts offscreen. In fact it takes up about a quarter of the screen instead of the half screen that I wanted. That makes me think that the scene's anchorpoint is offscreen and its not being entirely shown on the screen either?
Anyways I would like to display a black rectangle that takes up the left half of the screen.
Upvotes: 1
Views: 132
Reputation: 4887
I fixed this by changing the scaleMode to ResizeFill, by default it is AspectFill. Really I'm not entire sure about all these 4 different scaling modes but ResizeFill did it for me.
Upvotes: 1