Lagging Scroller

Getting into LiveCode for iOS? Ask your questions here.

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller

Post Reply
Jarren
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 21
Joined: Sat Jan 19, 2013 3:31 am

Lagging Scroller

Post by Jarren » Mon Apr 01, 2013 12:50 am

Hello everyone, I might be a new face on the forum, but I've been using LiveCode for over a year now, and have successfully published my first app back in September. I've also been silently lurking these forums now and again to glean new information.

I've been working on a sort of version 2 of my current app, re-hauling the interface and trying to make optimization to the code to slim things down and support more device resolutions. I'm running into issues with the native iOS scroller. I have roughly 20 objects inside of the scroller, primarily being graphic rectangles, and a couple of images. In the iOS simulator, the scrolling is smooth, but as soon as I deploy it to my iPhone 4, it becomes extremely slow and laggy. This is odd, because my previous app had a scroller containing over 150 images, and it scrolls very smoothly.

I have all the settings correct, Accelerated rendering set to true, every layer mode is set to scrolling. I am not using any graphic effects on the graphics.

If someone could take a look at it, it would be greatly appreciated. Who knows, maybe I'm just missing something small, another set of eyes is always useful. Just look in the "Score" card script for the scroller handlers.
Demo.zip
(24.68 KiB) Downloaded 347 times
Thanks,
Jarren

endernafi
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 296
Joined: Wed May 02, 2012 12:23 pm
Contact:

Re: Lagging Scroller

Post by endernafi » Mon Apr 01, 2013 9:09 am

Hi Jarren,
every layer mode is set to scrolling.
That's the problem.
LiveCode works in a different way regarding the layer modes.
Only the layer mode of the topmost control is valid.
I mean, the owner of that particular object {group, image, etc.}
whose layer mode is set to "scrolling" must be the card itself.

Try this:
* Set the layer mode of every each control to static.
* Then, set the layer mode of group "ScrollingGroup" to scrolling.

That should do it.
I applied these changes to your stack and it scrolls smoothly in an old iPod Touch :wink:

You can check this link, additionally.

It's a very nice looking app, btw, congrats...


Best,

~ Ender Nafi
~... together, we're smarter ...~
__________________________________________

macOS Sierra • LiveCode 7 & xCode 8

Jarren
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 21
Joined: Sat Jan 19, 2013 3:31 am

Re: Lagging Scroller

Post by Jarren » Mon Apr 01, 2013 2:17 pm

Thank you Ender! I had no idea! I was racking my brain trying to figure out what was wrong. I will definitely update it with the changes you suggested.

Thanks for the compliment on the look of the app, my first passion has been graphic design, next to coding.

Jarren

endernafi
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 296
Joined: Wed May 02, 2012 12:23 pm
Contact:

Re: Lagging Scroller

Post by endernafi » Mon Apr 01, 2013 2:23 pm

Glad that it helped.

I'd like to grab a copy of the final version of your app.
When you publish it, could you post the itunes store link here?

Thanks,

~ Ender Nafi
~... together, we're smarter ...~
__________________________________________

macOS Sierra • LiveCode 7 & xCode 8

Jarren
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 21
Joined: Sat Jan 19, 2013 3:31 am

Re: Lagging Scroller

Post by Jarren » Mon Apr 01, 2013 2:41 pm

endernafi wrote:Glad that it helped.

I'd like to grab a copy of the final version of your app.
When you publish it, could you post the itunes store link here?

Thanks,

~ Ender Nafi
Sure thing, its for a very niche market that would have no use for you specifically, unless of course you were a 9-14 year old boy or girl who competes in First Lego League. (Google it to find out what exactly it is, and you might understand, for some reason I'm not allowed to link outside the forum)

endernafi
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 296
Joined: Wed May 02, 2012 12:23 pm
Contact:

Re: Lagging Scroller

Post by endernafi » Mon Apr 01, 2013 2:48 pm

for some reason I'm not allowed to link outside the forum
It's about the post count.
Only after a certain amount of post {posts to this forum} one can give outer links.

~ Ender Nafi
~... together, we're smarter ...~
__________________________________________

macOS Sierra • LiveCode 7 & xCode 8

Jarren
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 21
Joined: Sat Jan 19, 2013 3:31 am

Re: Lagging Scroller

Post by Jarren » Tue Apr 02, 2013 1:34 am

Finally got the time to do it tonight! Thanks a bunch! Scrolls like molten butter! (for a lack of a better way to describe it :P)

jstarkman
Posts: 47
Joined: Wed Mar 16, 2011 4:39 am

Re: Lagging Scroller

Post by jstarkman » Mon May 06, 2013 8:40 pm

Hi Jarren,

My app has a series of buttons & fields that are organized in a scrollgroup as well. I understand how to make them scroll, but your reference to 'molten butter' caught my eye.

My form contains perhaps 60 to 70 objects, and although they are set up properly, they don't scroll in a 'zippy' manner, but more like 'molten mollasses'. The scolling is smooth, but lags behind the touch location a bit. Is that what you're seeing in your app as well?

Joel

Jarren
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 21
Joined: Sat Jan 19, 2013 3:31 am

Re: Lagging Scroller

Post by Jarren » Fri May 10, 2013 4:39 am

jstarkman wrote:Hi Jarren,

My app has a series of buttons & fields that are organized in a scrollgroup as well. I understand how to make them scroll, but your reference to 'molten butter' caught my eye.

My form contains perhaps 60 to 70 objects, and although they are set up properly, they don't scroll in a 'zippy' manner, but more like 'molten mollasses'. The scolling is smooth, but lags behind the touch location a bit. Is that what you're seeing in your app as well?

Joel
I have 86 items in my scroller. All of them are either shapes or fields, with the exception of 7 small images. On the iPhone 4 it scrolls very smoothly, and I can whip my finger up and down as fast as possible and the scroller is stuck to the original position I touched at. Not sure whats going on with your scroller then....

Post Reply