I have just started working with the Gideros Platform and so far it's great
I was wondering if it would it be possible to create a "Slide and Snap" menu like the UIScrollView for iOS (or the ViewPager on Android)?
Any code samples would be much appreciated
Glad you liked Gideros Studio
So far we've focused on graphical, native mobile application programming with a complete IDE & SDK. A native UI widget library will be one of our next targets, after the plugin infrastracture is written. This way, either us or any 3rd parties will be able to impmement native UI widgets.
Recently, we've published a Scene Manager class (http://www.giderosmobile.com/forum/discussion/69/is-scene-transitions-supported#Item_8) and we're planning to extend by allowing page transitions by swipe gesture. When we release a new version, we'll announce here.
Thanks for the advice. I can see Gideros becoming a very big player in mobile game development as so far it's really easy to use. I guess it's possible to create the menu because the game Tim Timber (created with gideros) has a slide snap menu when selecting the level.
Yes, you're right. I've looked at the Tim the Timber's level selection menu code and it is about ~200 lines of code. The basic logic is as follows:
1. Create menu pages
2. Draw only the visible pages by addChild/removeChild
3. on Event.MOUSE_DOWN, store the starting point
4. on Event.MOUSE_MOVE, calculate distance between starting point and current point. If we move more than 10 pixels, start dragging pages around.
5. on Event.MOUSE_UP calculate the speed of swipe and continue to move the pages until it locks.
Did this code sample ever get released?
Author of Learn Lua for iOS Game Development from Apress ( http://www.apress.com/9781430246626 )
Cool Vizify Profile at https://www.vizify.com/oz-apps
Addition to @OZApps, there is a great code developed by @ar2rsawseen: