crashoverride777 / swifty-sk-scroll-view

A Swift library to add a UIScrollView to your SpriteKit scenes. This library is deprecated and no longer supported.
MIT License
60 stars 11 forks source link

Scrolling speed #3

Closed NextNextNext closed 5 years ago

NextNextNext commented 7 years ago

Hello :) Thank you very much for creating this, it's been very helpful for me as a beginner. I have got it to run quite nicely in a little project of mine, but Im curious about the speed of the scrolling.

In both my own project, and the sample that comes with the code the scrolling appears to be rather slow when compared to default apps (such as the clock or settings menus), or even other third party apps. I've had a look and couldn't find any obvious way (keeping in mind I'm new) to increase the speed.

Thanks again Note: Im testing this a device, and FPS are a stable 60 so it's shouldn't be that

crashoverride777 commented 7 years ago

Hey,

Thanks for using this helper, glad its helping you. There is no straight forward way to change the speed. I personally think the default speed is perfect. I also think it depends on how many items/pages you have but not exactly sure how its handled in the background.

If you want to try to tweak it yourself have a look at this

http://stackoverflow.com/questions/11561992/sensitivity-scroll-speed-of-uiscrollview-with-paging

I have a look at this myself soon and might integrate this into a future update

Hope this helps

NextNextNext commented 7 years ago

No worries, thank you for your reply. I will keep investigating :) Edit: As an aside, I found a similar project (https://github.com/bobmoff/ScrollKit) which seems to have faster scrolling. The code certainly isn't as novice-friendly as this one however!

crashoverride777 commented 7 years ago

You are very welcome. Please if you find a good solution share it here.

NextNextNext commented 7 years ago

I asked a friend to have a look over the code, and he found my problem. It was quite a small and easy tweak. It was a line in the GameViewController: let scene = MenuScene(size: CGSize(width: 768, height: 1024)) (simulator preview) Changing that to: let scene = MenuScene(size: skView.bounds.size) (simulator preview) corrected the view, and as result solved my perceived scrolling issue :)

crashoverride777 commented 7 years ago

Hey

I would not do this, your game will look totally different on each iOS device. You will have to adjust for sprite sizes, physics, font sizes etc on each device.

Setting the scene size to skView.bounds.size or setting scale mode to .ResizeFill, which is basically the same, is bad IMO.

Try yourself with those settings, test your game on iPhone 5, 7, 7Plus, iPad and you will see its totally different and not consistent.

Hope this helps