SpriteKit iPhone/iPad different resolution, need same physics

后端 未结 1 1203
囚心锁ツ
囚心锁ツ 2021-01-04 13:23

As I am porting an iPhone app that uses SpriteKit to iPad, I have been able to scale all the screen elements and font sizes using the height ratio of the iPhone 5 to iPad sc

1条回答
  •  走了就别回头了
    2021-01-04 14:10

    You can configure the SKPhysicsWorld object attached to the SKScene.
    It changes:

    • The gravity property that applies an acceleration to volume-based bodies in the simulation.
    • The speed property determines the rate at which the simulation runs.

    You can set those properties to values that seems good to you on an iPad. Changing the Physic World changes physics for all SKObjects.

    0 讨论(0)
提交回复
热议问题