Background image size Sprite Kit Game

后端 未结 9 2065
一生所求
一生所求 2020-12-23 09:51

i just started a new Sprite Kit project to learn how to use it. I watched and read a lot of tutorials but no tutorial has a answer for my question/problem.

I want to

9条回答
  •  予麋鹿
    予麋鹿 (楼主)
    2020-12-23 10:46

    This line returns size in points, not pixels. This is made because different devices have different resolutions, but will have same sizes in points. On non retina devices 1 point is 1 pixel and on retina devices 1 point is two pixels. Thats why you get this size from

    SKScene * scene = [MyScene sceneWithSize:skView.bounds.size];
    

    You don't want to double the size of scene since it will just be our of bounds of your screen, invisible.

提交回复
热议问题