Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Scroll View in SpriteKit

I want to make a vertical scrolling view for the level selector on my SpriteKit game, I don't know if I have to use UIScrollView or make it using the SpriteKit framework. Please if anyone knows the best way to do it and how let me know. Thanks.

like image 421
Facundo Schiavoni Avatar asked Aug 14 '15 00:08

Facundo Schiavoni


1 Answers

You have several options here.

It is possible to integrate UI elements into SpriteKit, but instead of adding children to self (your scene), you would add subviews to self.view. You would of course, work with the view now instead of a scene so theres a different way of positioning elements which you would have to work out. Theres quite a few examples of how to do this, here's one that might help you.

An alternative is using something like Scroll Kit, which helps you integrate a UIScrollView into SpriteKit very conveniently!

Also check out this question which might be exactly what you're looking for. Hope this helps!

like image 200
MaxKargin Avatar answered Oct 12 '22 18:10

MaxKargin