SKTexture and the scale property of a UIImage

后端 未结 3 512
挽巷
挽巷 2021-02-06 01:06

Is there any reason why an SKTexture appears to ignore the .scale of an image when constructed via textureWithImage:?

I have one i

3条回答
  •  生来不讨喜
    2021-02-06 01:29

    I've found this too and believe it's a bug. Not sure how Apple are going to rectify this as it could break existing code.

    My workaround is to read the scale of the UIImage and then set the scale of the SKSpriteNode to 1.0 / scale. You need to do this for both the x and y scales of the SKSpriteNode.

提交回复
热议问题