Interesting.
And perfectly understandable response. Let me elaborate a little.
My “stuff” I call BGViews, and they are updated with UpdateBGViews() inside my onFrame() listener, which is a Runtime “enterFrame” listener, so yeah, pretty much checking this every basic cycle. Inside that, I basically check the scrollView:getView() current Y position, and if we are looking through a window, adjust the offset Y for each of the BGView layers visible through the window based on how far we’ve moved in the scrollView.
I certainly could do the same thing for the Foreground JPEG2000 images which contain the windows in their artwork and push the actual scrollView to the bottom, but I guess I originally worried about lag or unsmoothness. Also, those are BIG images (compared to what we’re seeing out the “windows”) and they don’t need to move in a sophisticated manner, just all together with the scrollView, and smoothness is important, since there is readability involved. (It is kinda like an eBook with “windows” being pictures, much like Device 6 in basic layout, but…well, different). In fact, in the @4 case, the images are 4096 pixels tall x 4 of them, for a scrollView height of 16,384 per “page/load screen.” I split them into 4 pieces because of JPEG size limitations and at load time put them back together in the scrollView in sequence.
I guess I was concerned with keeping them connected or them not updating correctly if I simply use a “connection mechanism” like I am with the views behind. (On extreme scrolling of the scrollView, I do notice the BGViews aren’t always updated quite as smoothly as the scrollView is.) I can try your scheme, but I think that was my original thinking. (Well, that and the fact that I was just learning lua and Corona as I went, so the big scrollView kinda came first.)
I’m guessing in your proposed order, I’d need to at least put a filled Rectangle in the scrollView to define its height and have something to receive the touches at the bottom? (Some of my pages are not the full 16,384 height and if I don’t put those newImageRects in there, it only scrolls as far as I’ve defined/filled, which is handy.)
I can try to decouple the JPEG2000s from the scrollView and connect them and see if the update behavior is smooth enough. (Realistically, I could also check to see if they are even “on screen” and only update the Y position for the 2 of the 4 images that will be visible at any given time, which might improve performance over updating all 4, if there is danger of adding any lag between them.)
So, yes, my “connect” mechanism is pretty brute-force, in terms of checking the Y values of the scrollView and updating Y positions of BGView layers as needed. (I also do other tricks to them, like skew and scale, depending on whether I’m faking depth or perspective. It’s a little more complex than Device 6.)
So I think your proposal would work IF the updates to those images are always fast enough for a smooth scroll, compared to letting the scrollView handle moving those things.
z