1

We have four images at 3x resolution in an atlas folder in Xcode.

Inside the atlas folder, the image names are: 0@3x.png, 1@3x.png, 2@3x.png, and 3@3x.png.

The code for loading these images:

    // Set vars
    let placeholderAtlas = SKTextureAtlas(named: PlaceholderAtlasFilename)

    // Get number textures
    let numPlaceholders = placeholderAtlas.textureNames.count

    // Load placeholder sprites
    for i in 0..<numPlaceholders {
        let textureName = String(i)
        let texture = placeholderAtlas.textureNamed(textureName)
        placeholderTextures.append(texture)
    }

These images appear when we run the iOS 10 simulators, but the images do not appear on the iOS 9 simulators. The red X marks appear, suggesting the images were not found.

This was true for the following devices: iPhone 5s, iPhone 6, and iPhone 6s Plus.

In the console, there are no errors about loading these images.

Does this mean the images also won't load on real devices? We don't have iOS 9 test devices.

How can we fix this problem?

Crashalot
  • 33,605
  • 61
  • 269
  • 439
  • please check the image set to the targets? chick on the image and check for the target, check it if unchecked. – iUser Jun 22 '17 at 07:01
  • @iUser yes they are checked for the target. they must be, right? otherwise, how would they appear on the iOS 10 simulators? any other suggestions? thanks! – Crashalot Jun 22 '17 at 07:04
  • @Crashalot Impossibility of downgrading iOS really sucks... I don't get how it is meant to support older systems if we can't test our apps on them... Simulators are not always relevant... Anyways, before jumping into research & testing, have you tried to clean simulator's content and cache ? – Whirlwind Jun 22 '17 at 07:52
  • @Whirlwind good idea, will try that and report back. thanks! – Crashalot Jun 22 '17 at 10:03
  • I think this is a bug in iOS 9 which was fixed in iOS 10 (occurs when using the Atlas folder) no? – Zigglzworth Jun 22 '17 at 11:11
  • @Zigglzworth yup when using the atlas folder. any documentation on this? when you say bug, do you mean it also happens on devices? – Crashalot Jun 22 '17 at 14:39
  • I couldn't find any official documentation anywhere but I've seen others mention it as an issue in iOS 9 and believe it happens on devices too – Zigglzworth Jun 22 '17 at 16:53
  • @Crashalot yes this was an old bug that refused to load 3x images and instead would only load 2x images. I think it got fixed during the later stages of iOS 9 – Knight0fDragon Jul 15 '17 at 14:02
  • https://stackoverflow.com/questions/28146685/spritekit-not-loading-3x-images-from-sktextureatlas I actually wrote a workaround a long time ago lol forgot all about this – Knight0fDragon Jul 15 '17 at 14:04

0 Answers0