In this case, you cannot use the spriteNodeWithImageNamed: method. You yourself need to create a texture from an absolute path and initialize your sprite using this texture:
NSImage *image = [[NSImage alloc] initWithContentsOfFile:absolutePath]; SKTexture *texture = [SKTexture textureWithImage:image]; SKSpriteNode *sprite = [SKSpriteNode spriteNodeWithTexture:texture];
Note that doing so will lose the performance optimization used with spriteNodeWithImageNamed: (for example, caching and improved memory handling).
I recommend putting your images in the main set and using a specific naming scheme as follows:
monster_001.png monster_002.png monster_003.png etc...
As an alternative, consider using texture atlases .
source share