Moving large image
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller
-
- Livecode Opensource Backer
- Posts: 211
- Joined: Sun Oct 24, 2010 12:13 am
Moving large image
For an iPad app we're working on, we want to animate the movement of a very large image. Doesn't matter whether I use animationEngine or script it myself, I am incapable of doing anything resembling smooth animation. I don't mean "it's a little jumpy", I mean it's doing 4 frames a second.
We have a big image that covers the screen. We want to be able to animate the image to move 200 pixels up, revealing a "Dock" area at the bottom of the card. No matter what I try, I'm getting dismal performance on the iPad. This is with LiveCode 5.0.1.
I've set the layermode of the image to "Dynamic." I'm setting the acceleratedRendering to "True." I'm setting the Quality to "Normal."
If the image were plain, I could just use a visual effect and use two cards to accomplish what I want or even lock the card and do a visual effect unlock. But the image has patterns on it, so none of the visual effects work. Which is unfortunate, because the visual effects work very smoothly.
Any ideas or suggestions appreciated. I would imagine this would be the same problem as someone building a game where the background is moving left to right. At 4 frames a second it'd be ugly.
We have a big image that covers the screen. We want to be able to animate the image to move 200 pixels up, revealing a "Dock" area at the bottom of the card. No matter what I try, I'm getting dismal performance on the iPad. This is with LiveCode 5.0.1.
I've set the layermode of the image to "Dynamic." I'm setting the acceleratedRendering to "True." I'm setting the Quality to "Normal."
If the image were plain, I could just use a visual effect and use two cards to accomplish what I want or even lock the card and do a visual effect unlock. But the image has patterns on it, so none of the visual effects work. Which is unfortunate, because the visual effects work very smoothly.
Any ideas or suggestions appreciated. I would imagine this would be the same problem as someone building a game where the background is moving left to right. At 4 frames a second it'd be ugly.
-
- Livecode Opensource Backer
- Posts: 211
- Joined: Sun Oct 24, 2010 12:13 am
Re: Moving large image
Eww. Doing a forum search all I can find is more of the same. Decent animation of large objects on an iPad looks to be impossible...
Re: Moving large image
Try this:
http://dl.dropbox.com/u/67170/dockexample.livecode
I'm not using a really huge image, but it demonstrates one solution. BTW you can drag the image around to see it work wherever the image is.
Gerry
http://dl.dropbox.com/u/67170/dockexample.livecode
I'm not using a really huge image, but it demonstrates one solution. BTW you can drag the image around to see it work wherever the image is.
Gerry
14" MacBook Pro
Former LiveCode developer.
Now recovering.
Former LiveCode developer.
Now recovering.
-
- Livecode Opensource Backer
- Posts: 211
- Joined: Sun Oct 24, 2010 12:13 am
Re: Moving large image
Gerry,
Thanks for sharing your stack with me. I had some difficulties opening it on my iPad, but I was able to look at the scripts.
I ended up figuring out a pretty good workaround for my issue. I put the image in a group and set the group to be the size of the iPad screen, then I used iphoneControlCreate "scroller" to allow the iOS to speed up the scrolling. Then I used a repeat loop to change the vscroll of the group. It actually works pretty darn good - I wouldn't call it super smooth, but it's got to be 4 times faster than doing it the old way. It's good enough for our app, though.
Thanks for sharing your stack with me. I had some difficulties opening it on my iPad, but I was able to look at the scripts.
I ended up figuring out a pretty good workaround for my issue. I put the image in a group and set the group to be the size of the iPad screen, then I used iphoneControlCreate "scroller" to allow the iOS to speed up the scrolling. Then I used a repeat loop to change the vscroll of the group. It actually works pretty darn good - I wouldn't call it super smooth, but it's got to be 4 times faster than doing it the old way. It's good enough for our app, though.
Re: Moving large image
Did it run in the simulator? Anyway, glad you found a solution (although it seems very complicatedrichardmac wrote:Gerry,
Thanks for sharing your stack with me. I had some difficulties opening it on my iPad, but I was able to look at the scripts.

Gerry
14" MacBook Pro
Former LiveCode developer.
Now recovering.
Former LiveCode developer.
Now recovering.
-
- Livecode Opensource Backer
- Posts: 211
- Joined: Sun Oct 24, 2010 12:13 am
Re: Moving large image
Hmm. Didn't try it in the simulator until just now. It works, but it's not animated - it sort of dissolves and reappears really quickly, which is not the same as seeing it actually move, which is what we needed. But yeah, our workaround is complicated, but the animation is reasonably smooth.
Re: Moving large image
You can use the move command instead. I didn't, as for some reason I got sucked in by your mention of visual effectsrichardmac wrote:Hmm. Didn't try it in the simulator until just now. It works, but it's not animated - it sort of dissolves and reappears really quickly, which is not the same as seeing it actually move, which is what we needed. But yeah, our workaround is complicated, but the animation is reasonably smooth.

Gerry
14" MacBook Pro
Former LiveCode developer.
Now recovering.
Former LiveCode developer.
Now recovering.
Re: Moving large image
I've updated the stack to use the move command. Use the same link.
Gerry
Gerry
14" MacBook Pro
Former LiveCode developer.
Now recovering.
Former LiveCode developer.
Now recovering.
-
- Livecode Opensource Backer
- Posts: 211
- Joined: Sun Oct 24, 2010 12:13 am
Re: Moving large image
Yup - got it. That works well - pretty much the same speed as the workaround, but way easier and way more logical. Sweet! Thanks for taking the time to do this - I really appreciate it.Jellicle wrote:I've updated the stack to use the move command. Use the same link.
Gerry
