UIInterpolatingMotionEffect is intended for use with UIView, but is there a possibility to use it within SpriteKit on a node ?
If not, does someone has an idea to realize the effect another way.
Thanks in advance
UIInterpolatingMotionEffect is intended for use with UIView, but is there a possibility to use it within SpriteKit on a node ?
If not, does someone has an idea to realize the effect another way.
Thanks in advance
Creating a parallax effect in Sprite Kit can be achieved by creating a set of
SKNode
layers, adding sprites to the layers, and then moving each layer by a different amount when the user tilts the device. You can optionally scale the layers to give the illusion of depth.Here's an implementation in Swift. Since it uses the accelerometer, this will only work on a device (not the Simulator).