SCNView 快照图像不包括 overlaySKScene
SCNView snapshot image does not include the overlaySKScene
使用 iOS 10.3 & Xcode 8.3
我添加了这样一个叠加场景:
self.scnView.overlaySKScene = someUI; //SpriteKit SKScene
但是当我尝试拍摄快照时:
UIImage *image = [self.scnView snapshot];
快照图像仅显示 3D 场景,未显示叠加场景。但它在屏幕上看起来一切正常,这意味着我可以看到 3D 场景和叠加层。
如何获取包含 overlayScene 的快照?
糟糕。如果您将 scnView.background 设置为任何颜色(alpha=1),除了 clearColor.
我已将 scnView.background颜色设置为 clearColor。
self.scnView.backgroundColor = [UIColor clearColor];
我假设叠加层位于 of/above 3D 场景之上,背景为 below/behind 3D 场景。所以我没想到 clearColor 背景也适用于叠加场景。那好吧。
使用 iOS 10.3 & Xcode 8.3
我添加了这样一个叠加场景:
self.scnView.overlaySKScene = someUI; //SpriteKit SKScene
但是当我尝试拍摄快照时:
UIImage *image = [self.scnView snapshot];
快照图像仅显示 3D 场景,未显示叠加场景。但它在屏幕上看起来一切正常,这意味着我可以看到 3D 场景和叠加层。
如何获取包含 overlayScene 的快照?
糟糕。如果您将 scnView.background 设置为任何颜色(alpha=1),除了 clearColor.
我已将 scnView.background颜色设置为 clearColor。
self.scnView.backgroundColor = [UIColor clearColor];
我假设叠加层位于 of/above 3D 场景之上,背景为 below/behind 3D 场景。所以我没想到 clearColor 背景也适用于叠加场景。那好吧。