我希望将我的GameScene的背景颜色从黑色更改为白色并具有淡化效果。我该怎么做?我尝试过使用动画。
答案 0 :(得分:0)
UIView.animate(withDuration: 1, animations: {
self.viewForBackGroundChange.backgroundColor = UIColor.red
})
这应该有效。我在这里采用了一个视图的例子,用你希望使用的组件的背景层替换它。
答案 1 :(得分:0)
我使用了这段代码:
self.run(SKAction.colorize(with: UIColor.white, colorBlendFactor: 1,
duration: 10))