There is no problem with a Spritekit project running on other devices (either a real machine or an emulator), but on the IPhone6 plus there is an over-amplification of the Sprite object texture:
You can see that either the protagonist or the prop ball is too big.
Look at this. The sprite image is placed in the Atlas Texture set folder:
You can see that both PowerUp and Player have scaled versions: Player.png,[email protected] and [email protected]
In the properties of each picture to check the size of the picture is also correct, see not the horse problem ...
Find the code for the Skspritenode object initialization to see:
let"PowerUp")
It seems that there is no problem ... Suddenly think that the above images are placed in the texture set, then all should be added to Xcode to form an additional whole picture, is there a problem?
Put the player in a total of 3 pictures in Assets.xcassets:
PowerUp also do the same, and then compile and run the code again, this time all the elves are the correct size, no amplification situation! It seems that the @x suffix is only valid for direct image resources, because you put the picture in the texture set, so system processing will go wrong.
But what if I just want to use a texture set?
Change the original initialization code of Skspritenode to the following:
let"sprites")let texture = atlas.textureNamed("PowerUp")let orbNode = SKSpriteNode(texture: texture)
This time everything is fine:
Why is there a problem on the iphone6p? Because 6p introduces a new 3x mode, all previous 2x (including 6), it is estimated to stumble here;]
PS: If you change the code in 6p to the following:
let"[email protected]")
Attention is 2x Oh!
Skspritenode object initialization shows incorrect analysis and resolution in iphone 6 Plus