newScrollView scrollToPosition easing

Anybody know a way to change the easing transition for “scrollToPosition” (or “scrollTo”)?

I’m making a simple credits screen and the easing appears to be cubic so it speeds up as the credits roll. I’d prefer linear.  Something like this (but this doesn’t work):

credits:scrollToPosition({y=-2000, time=40000, transition = easing.linear })

I believe, since the Widgets lib has been open-sourced, you could dig through the code and see if this has been implemented, and if not, implement it yourself:

https://github.com/coronalabs/framework-widget

IT WORKED! Great suggestion. Line 222 of widget_scrollview.lua is the culprit. I simply changed it to:

transition.to( self.\_view, { x = newX, y = newY, time = transitionTime, transition = easing.linear, onComplete = onTransitionComplete } )

I tried to get fancy and use options.easing as a variable so I could change it in the settings of each scrollview but other stuff broke so I gave up.

Super-cool that you fixed it!

If you have written code to expose the transition easing (instead of just changing the easing from one static type to another) submitting a pull request through the github would be appreciated, as then Corona can incorporate your updates in their next update.

I’ve been trying to implement this but am having some issues…  Not finding any documentation on how to implement the widget library from GitHub and not use the default require(‘widget’).

Do I use only this file, or do I need to include the whole library?

https://github.com/coronalabs/framework-widget/blob/master/widgetLibrary/widget_scrollview.lua

Many parts of the library as a whole seem a bit outdated…

Thanks,

Nate

You probably should get the whole library. The whole library should have a file “widget.lua” that would be in the folder with your main.lua and the rest of the items in a folder.

When you require a module, it looks in your local system.ResourcesDirectory first before looking for system wide resources. That way your local widget.lua would be what was being required instead of the global one.

Rob

I believe, since the Widgets lib has been open-sourced, you could dig through the code and see if this has been implemented, and if not, implement it yourself:

https://github.com/coronalabs/framework-widget

IT WORKED! Great suggestion. Line 222 of widget_scrollview.lua is the culprit. I simply changed it to:

transition.to( self.\_view, { x = newX, y = newY, time = transitionTime, transition = easing.linear, onComplete = onTransitionComplete } )

I tried to get fancy and use options.easing as a variable so I could change it in the settings of each scrollview but other stuff broke so I gave up.

Super-cool that you fixed it!

If you have written code to expose the transition easing (instead of just changing the easing from one static type to another) submitting a pull request through the github would be appreciated, as then Corona can incorporate your updates in their next update.

I’ve been trying to implement this but am having some issues…  Not finding any documentation on how to implement the widget library from GitHub and not use the default require(‘widget’).

Do I use only this file, or do I need to include the whole library?

https://github.com/coronalabs/framework-widget/blob/master/widgetLibrary/widget_scrollview.lua

Many parts of the library as a whole seem a bit outdated…

Thanks,

Nate

You probably should get the whole library. The whole library should have a file “widget.lua” that would be in the folder with your main.lua and the rest of the items in a folder.

When you require a module, it looks in your local system.ResourcesDirectory first before looking for system wide resources. That way your local widget.lua would be what was being required instead of the global one.

Rob