-1

So I am working on a simple SpriteKit ball and obstacle game. I have the zposition for the nodes set to 2 ( can be 1 but I set it to 2 to make sure it doesn’t interfere with anything else)

I am trying to add a background to it but instead of an image my I want to use a UIview as the background for my game. How should I use a uiview as a background for a SpriteKit scene. ?

The uiview I’m using is called Pastel. It’s a library that allows you to create animated gradient backgrounds like the Instagram app login screen. I tried adjusting the position at

And I’ve even used the sendabove and sendbelow methods but they don’t work

Aman Kapoor
  • 90
  • 1
  • 6
  • Possible duplicate of [How to create a Gradient in Spritekit?](https://stackoverflow.com/questions/19254957/how-to-create-a-gradient-in-spritekit) – Craig Siemens Jul 16 '18 at 21:47

1 Answers1

0

In order for UIView with your background which is under SKView to become visible, you must set the allowsTransparency property of your SKView to true.

Edit:

you also need to set the SKView and the SKScene background color to clear – (thanks to Knight0fDragon)

Max Gribov
  • 388
  • 2
  • 7