SKAction Timer, Horrible SpriteKit Rendering Performance

I do what I think this is a very simple timer panel, on which nothing else is on the screen. But it can't support 60 frames per second on the iPad Pro ... Am I doing something obviously heavy and wrong?

let previewTime: TimeInterval = 3.0 func timerBar(){ let tbW: CGFloat = frame.size.width / 2 let tbH: CGFloat = 64 let tbSize = CGSize(width: tbW, height: tbH) let timerBox = SKSpriteNode(color: SKColor.black, size: tbSize) timerBox.anchorPoint = CGPoint(x: 0.0, y: 0.0) timerBox.position = CGPoint(x: frame.size.width / 2 - (tbW / 2), y: 500) timerBox.zPosition = 8 addChild(timerBox) let timerBoxBar = SKSpriteNode(color: .white, size: tbSize) timerBoxBar.anchorPoint = CGPoint(x: 0.0, y: 0.0) timerBoxBar.position.x = 0.0 timerBoxBar.position.y = 0.0 timerBoxBar.xScale = 0.0 timerBox.addChild(timerBoxBar) let animPreviewTime = SKAction.scaleX(to: 1, duration: GameScene.previewTime) timerBoxBar.run(animPreviewTime){self.randomisePositions()} } 

This makes the timer panel with a black background and a white timer panel, which animates on the screen for 3 seconds until the timer panel is full.

It stutters, apparently, and the tools show it using the blue moments of the blue stroke, sufficient to consistently make it stutter.

Update

Here, bursts appear during the rendering of this, as you can see, on both sides of the timeline animation, absolutely NOTHING:

enter image description here

Xcode Version 8.2 beta (8C23)

iOS 10.2 Beta 2

Downloading iOS 10.2 beta 3 now ...

+5
source share

Source: https://habr.com/ru/post/1259857/


All Articles