Frame animation

Getting into LiveCode for iOS? Ask your questions here.

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller

Post Reply
chelling
Posts: 100
Joined: Tue Mar 06, 2007 3:14 am

Frame animation

Post by chelling » Sun Jun 22, 2014 9:47 pm

I am trying to make a simple animation of a rotating ball run as smoothly on a Retina display as it does on the iPad. I have set the acceleratedrendering to true in openStack, and the layerMode of the button is set to dynamic. I even increased the number of png's I am cycling through from 25 to 50. On the Retina simulator, it looks like I am looking at it with double vision. What am I doing wrong?

Simon
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 3901
Joined: Sat Mar 24, 2007 2:54 am

Re: Frame animation

Post by Simon » Sun Jun 22, 2014 10:36 pm

Hi chelling,
Have you tried with just one image and using "angle"? Check it out in the Dictionary.

Simon
I used to be a newbie but then I learned how to spell teh correctly and now I'm a noob!

chelling
Posts: 100
Joined: Tue Mar 06, 2007 3:14 am

Re: Frame animation

Post by chelling » Sun Jun 22, 2014 11:21 pm

That works pretty well for the ball. Thanks Simon! It would still be nice to have a way to do the animation cycling through png files. Not all animations are simple rotations. Do you think that a movie file will have to be used in those situations?

Simon
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 3901
Joined: Sat Mar 24, 2007 2:54 am

Re: Frame animation

Post by Simon » Sun Jun 22, 2014 11:40 pm

Swapping through image files is processor intensive, not something you want to do on a mobile device.
Here a nice one from Scott Rossi
http://andregarzia.on-rev.com/alejandro ... gman_2.zip

Simon
I used to be a newbie but then I learned how to spell teh correctly and now I'm a noob!

chelling
Posts: 100
Joined: Tue Mar 06, 2007 3:14 am

Re: Frame animation

Post by chelling » Mon Jun 23, 2014 12:01 am

That's pretty much how I am managing the animation. There are two script local variables, one holds the number of images and the other holds the current image number. So, in the game loop, I am checking to see if the current frame + 1 is > or < the number of images, and then setting the icon of the button accordingly. This is from Game Academy. Do you think if I used less images it would run smoother on the Retina Display? I thought that swapping images was the preferred way to manage animations, so I am pretty surprised to learn that it is actually processor intensive.

Simon
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 3901
Joined: Sat Mar 24, 2007 2:54 am

Re: Frame animation

Post by Simon » Mon Jun 23, 2014 12:13 am

Maybe memory intensive is a better description.
Now if you did a lot of work and manipulated points of a graphic object you'd be rocking.

Simon
I used to be a newbie but then I learned how to spell teh correctly and now I'm a noob!

chelling
Posts: 100
Joined: Tue Mar 06, 2007 3:14 am

Re: Frame animation

Post by chelling » Mon Jun 23, 2014 12:27 am

Right - SVG support cant get here soon enough :D

Post Reply