Monday, August 15, 2022
HomeiOS Developmentios - Discover display decision in Swift

ios – Discover display decision in Swift

[ad_1]

I’m writing an iOS sport in Swift utilizing Spritekit and need to discover the display decision to correctly place my sprites. I discovered a number of methods on web, however none of them is giving me an accurate decision that assist me to position my sprites.
The one which works fantastic for an iPhone 13 Professional is the next

screenSize=self.dimension
screenSize.width /= (UIScreen.primary.bounds.top/screenSize.top) / (UIScreen.primary.bounds.width/screenSize.width)

However on an iPad for instance, the size are too huge.
Is there a novel approach of discovering display decision on all units ? Or is there a scene scaling that enters within the equation ?

[ad_2]

RELATED ARTICLES

Most Popular

Recent Comments