2014-10-02 60 views
1

大家我學習SpriteKit的iOS的Xcode 6,並試圖使用以下代碼SpriteKit iPhone 6模擬器表示填充

self.atlas = [SKTextureAtlas atlasNamed:@"sprite"]; 

    // set background 
    SKSpriteNode * background = [SKSpriteNode spriteNodeWithTexture:[self.atlas textureNamed:@"background"]]; 
    background.position = CGPointMake(CGRectGetMidX(self.frame), CGRectGetMidY(self.frame)); 

    [self addChild: background]; 
添加的圖像(640×1136),其從所述sprite.atlas背景

但問題是在iPhone 6模擬器有白色邊框填充整個圖像,但它在iPhone 4s模擬器看起來很好。

image with padded border

能否請你告訴我如何擴大圖像全屏顯示。有沒有需要添加的設置?

預先感謝您

+0

這個問題已經在這裏找到答案:http://stackoverflow.com/questions/19471761/background-image-size-sprite-kit-game 您可以修改佈局通過在ViewController.m的viewDidLoad函數中改變aspect fill/fit/etc模式。 – 2016-01-27 00:18:51

回答