Comments (5)
Ohh that's awesome, I really haven't tried working with SpriteKit, but it could be superb if you could open a PR with a fix, thanks!!!
from snap.swift.
This needs a bit more work, it doesn't seem to capture Retina images. Also I added some code to capture SpriteKit views in the hierarchy via a workaround: it adds an image view with the captured image via the SpriteKit API before capturing the whole view:
ralfebert@b0b0203
It works fine for me, but I think this code needs a bit more testing/polishing.
from snap.swift.
I found that all these cases can be handled easily by using the UIView snapshotView method. It returns a "image" view which can be drawn using drawHierarchy and always shows what a user would see. I am currently using this in UIView+render and it does seem to do the trick.
from snap.swift.
Ahh, big relevation: drawHierarchy works fine! But currently, Snap renders the layer of the view on top of the view in UIView+Render:
drawHierarchy(in: bounds, afterScreenUpdates: true)
layer.render(in: context) // <---
And this breaks capturing views from GLKit, SceneKit and SpriteKit.
What is this about / for what is rendering the layer needed / is this not included in drawHierarchy?
from snap.swift.
Ah, drawHierarchy only works when a UIWindow is present, thats why layer.render is there as well.
But I think rendering twice, once using drawHierarchy, then on top of it as a layer isn't correct (I also saw some render glitches due to that).
I am currently working on a pull request to properly capture SpriteKit and SceneKit.
I think always using layer.render() is the way to go, because it also works headless without a host application.
from snap.swift.
Related Issues (20)
- Autolayout issues
- Integrate kaleidoscope HOT 2
- Wrong Carthage dependencies
- Weird framework naming [in docs] HOT 5
- Alpha channels on exported images
- Make size property of Device type public HOT 1
- Support camelCase for test method names
- Remove `test` method prefix from reference files HOT 3
- Write Failed Image if Reference image not found HOT 2
- API to expect UIImage HOT 2
- Device.iPadAir.size.width = 788?
- Landscape support HOT 1
- Image metadata differs depending if images are recorded under iOS 9 or iOS 10
- UITraitCollection support HOT 1
- Debugging failure on Travis CI HOT 3
- Default simulator? HOT 1
- cocoapods release? HOT 2
- Snapchat login
- This tool is no longer required as the unc0ver team have allowed sileo to work
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from snap.swift.