因为目前无法将 SKScene
的颜色设置为 clearColor
,方法是
-(id)initWithSize:(CGSize)size {
if (self = [super initWithSize:size]) {
self.backgroundColor = [SKColor clearColor];
}
return self;
}
如下所示:LINK
那么如何为 SKScene
设置背景图像?请尽可能具体,示例代码会很棒!
最佳答案
swift 4 版本:
let background = SKSpriteNode(imageNamed: "CheckIcon")
background.size = frame.size
background.position = CGPoint(x: frame.midX, y: frame.midY)
addChild(background)
关于ios - 如何设置 SKScene 的背景图片?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/19780638/