在不调用init的情况下从文件加载SKScene的方法(fileNamed:“”)

时间:2015-06-25 07:26:40

标签: swift sprite-kit scene

正如标题所说,我是否可以调用任何方法从文件(.SKS)加载SKScene而不调用init(fileNamed: "...")方法?

1 个答案:

答案 0 :(得分:0)

您可以这样做:

float screenWidth  = [UIScreen mainScreen].bounds.size.width;
float screenHeight = [UIScreen mainScreen].bounds.size.height;
GameScene *scene   = [[GameScene alloc]initWithSize:CGSizeMake(screenWidth, screenHeight)];

继续编码......:)