0
votes

I am going crazy trying to figure this out. I have a game that I have not worked on in some time. I loaded it up into Xcode and update to swift 5 from 4, all went fine. The game uses a number of larger but optimized graphics for background elements (PNGs around 1000x1500 px but optimized to 120k-500k in file size through limited palettes). Since the update the majority of these background elements (which are SKSpriteNode) are appearing as solid white sprites on the screen. A few of the smallest appear correctly. I can't find anyone experiencing the same on stackExchange. Has anyone else experienced this? Anyone know a solve.

Some of the sprites are added dynamically, and some are placed in an SKSceneNode using the scene editor.

If I print the non-working SKSpriteNode I get the following:

name:'(null)' texture:[ 'BG_Building_06.png' (218 x 1939)] position:{0, 0} scale:{1.00, 1.00} size:{218, 1939} anchor:{0.5, 0.5} rotation:0.00

And if I print the SKSpriteNode.texture I get:

Optional( 'BG_Building_06.png' (218 x 1939))

I have also tried halving the size of all the source pngs and that solves for most of them (but is not an ideal solution), so it definitely seems like it is an issue with the dimensions of the sprites. Odd that this worked with no problem in an older version but is now becoming an issue.

I am really going crazy trying to solve this.

Thanks.

1
Can you put a code example to replicate the error? - Maetschl
Probably the compressed limited color pngs. It is most likely not helping you out at all. - Knight0fDragon

1 Answers

0
votes

SpriteKit is still very buggy. If your code has not changed, and you still have this problem, it is most likely a bug. You can verify it by filing a bug:

https://developer.apple.com/bug-reporting/

Or by having a discussion in apples developer forums. The fastest way to know for sure is to file a technical support incident - they will either help you figure it out, or let you know if its a bug.