ios - sprite kit do not draw line at correct position in portrait mode -
sprite kit not draw line @ correct position in portrait mode
sprite kit not draw line @ correct position in portrait mode. try draw line in sprite kit. before today sprite kit working correctly when app in portrait mode draw x position wrong . try draw x position = -750/4 draws x -750/2 + 750/20. y position of line not correct also. how make work correctly?
extension gamescene{ func setscreensize(width inputwidth:double,height inputheight:double) { let coordinatesx = double(self.frame.size.width) // coordinatesx = 750 let coordinatesy = double(self.frame.size.height) // coordinatesy = 1334.0 } func drawshapenode() { thex = cgfloat(-750/4) = cgfloat(-1334.0/4) thepathtodraw.move(to: cgpoint(x: thex, y: they)) thepathtodraw.addline(to: cgpoint(x: 0, y: 0)) }
i found wrong position occurs when game view size width < screen width. why noticed today , normal before. making game view size width >= screen width fix it. error not related scroll view occurs when view not inside of scroll view.
Comments
Post a Comment