Im trying to show an enlarged preview of scene behind users finger when user presses the screen. Im extracting texture of node and adding it back to scene using below code
if let previewTexture = view?.textureFromNode(rootNode, crop: CGRect(origin: rootNodePoint, size: CGSize(width: 100, height: 100))) {
previewNode.texture = previewTexture
}
When I use the method with crop rect its returning nil, but without the crop its returning the texture fine.
I cannot get the complete texture first and then crop it since the whole node tree could expand to more than 4098 points, and sprite kit returns empty texture in such case.
I cannot use the UIView drawViewHierarchyInRect method since it will return a snapshot with preview itself in it.
I have created a sample project to reproduce the issue TextureFromNodeBug
Update:
This problem is not getting replicated on iOS 9.2, so this could be a framework bug