2
我工作的一個SWIFT3/SpriteKit屏幕保護程序和我有屏幕,除了我的工作不能讓我的紋理加載,因爲當我做到以下幾點:SKTextureAtlas是否可以從「my」包而非「host」包中加載包?
// load texture atlas
let textureAtlas = SKTextureAtlas(named: "Flyers")
的SKTextureAtlas正在尋找「飛人」在當在screensaverengine.app
內部運行時,主捆綁包不是紋理所在的捆綁包。
在我以前的對象 - 基於屏幕保護程序,我不得不做以下從包中加載圖片:
thisBundle = [NSBundle bundleForClass:[self class]];
fileName=[[NSString alloc ] initWithFormat:@"flyer%d", flyNum];
picturePath = [thisBundle pathForResource:fileName ofType:@"png"];
flyerImage= [[NSImage alloc ] initWithContentsOfFile:picturePath];
之前,我去加載圖像,並在運行時創建的紋理的路線,我想要點擊Stackoverflow家庭的一些幫助...想法?