1
我在SpriteKit中创建了一个垂直滚动游戏,我想在游戏结束时截取整个游戏场景的屏幕截图,包括已经滚动屏幕的部分。到目前为止,我只能捕捉到使用以下内容可见的部分屏幕:SpriteKit屏幕截图的屏幕截图
let bounds = self.scene!.view?.bounds
UIGraphicsBeginImageContextWithOptions(bounds!.size, true, UIScreen.mainScreen().scale)
self.scene?.view!.drawViewHierarchyInRect(bounds!, afterScreenUpdates: true)
screenshot = UIGraphicsGetImageFromCurrentImageContext()
UIGraphicsEndImageContext()
是否有可能获取整个场景?
谢谢。
据我所知,你只能捕捉用户可见的视图。有人纠正我,如果我错了 –