I'd like to take advantage of the particle effects (and maybe some other stuff) in SpriteKit but my app is mainly rooted in UIKit. Does the SpriteKit framework allow you to create a scene with a transparent background that I can place on top of my UIKit view hierarchy?
As of iOS 8, Apple has added this ability: see SKView.allowsTransparency
.
https://developer.apple.com/documentation/spritekit/skview/1519697-allowstransparency
It defaults to false
, yielding the black rectangle background you see; but set it to true
, set its background color to .clear
, and it composites over UIKit content just fine.
Further info: Removing Background of SKView - Particle Emitter - SpriteKit
Short answer is no. You can add SKView (subclass of UIView) to your view hierarchy, and set its scene to your own SKScene. But SKView has a backgroundcolor property that cannot be clear (defaults to grey). It seems possible in OSX mavericks, so hopefully apple will add this possibility in iOS as well.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With