Scrollview:getContentPosition() Bug

Hi,

When scrollview is active, getContentPosition works perfectly.

When scrollview is inactive, getContentPosition doesn’t update consistently or correctly. Scrollview:getView().y is no better.

I need this for a parallax effect within the scrollview.

Thank you,

Aidan Wolf

Aidan, 

The following is not an admonition, just being sure you know about this…

Are you trying to submit a bug or get help?  

If the prior, create a simple test case and file it here: https://developer.coronalabs.com/content/bug-submission

If the latter, the easiest way to get help is to:

  • Post a sample snippet so we can look at it for errors (keep it tight and short as possible)
  • Provide a simple sample (again, keep it short so we can easily inspect it) in a zip file and link it here.

DIY Short-term

Lastly, you can always get the code for the widgets and fix things in the short run (not necessarily the most fun option, but thankfully available) https://github.com/coronalabs/framework-widget

PS - I just happen to be doing some work w/ scrollview today, so I’ll take a look and see if I can figure anything out, but if you have a simple sample that would help immensely.  Thanks

Personally, I don’t believe widget.newScrollView() is the best way to do game scrolling in particular with parallax. Its going to be lower overhead and work better to your backgrounds and an enterFrame listener to move them at different speeds, detect when one of the backgrounds is off screen and move it to the other side to create an infinite scroll.

Rob

I needed this for a dynamic,floating music player on the scrollview, and a scrolling profile with a parallaxed profile effect. I solved these issues through some fancy grouping and animations.

Regardless, the benefit is managing touch events within the same view and I think it’s sensible to expect consistent behavior in widgets.

Aidan, 

The following is not an admonition, just being sure you know about this…

Are you trying to submit a bug or get help?  

If the prior, create a simple test case and file it here: https://developer.coronalabs.com/content/bug-submission

If the latter, the easiest way to get help is to:

  • Post a sample snippet so we can look at it for errors (keep it tight and short as possible)
  • Provide a simple sample (again, keep it short so we can easily inspect it) in a zip file and link it here.

DIY Short-term

Lastly, you can always get the code for the widgets and fix things in the short run (not necessarily the most fun option, but thankfully available) https://github.com/coronalabs/framework-widget

PS - I just happen to be doing some work w/ scrollview today, so I’ll take a look and see if I can figure anything out, but if you have a simple sample that would help immensely.  Thanks

Personally, I don’t believe widget.newScrollView() is the best way to do game scrolling in particular with parallax. Its going to be lower overhead and work better to your backgrounds and an enterFrame listener to move them at different speeds, detect when one of the backgrounds is off screen and move it to the other side to create an infinite scroll.

Rob

I needed this for a dynamic,floating music player on the scrollview, and a scrolling profile with a parallaxed profile effect. I solved these issues through some fancy grouping and animations.

Regardless, the benefit is managing touch events within the same view and I think it’s sensible to expect consistent behavior in widgets.