i've been using Core Animation to accomplish animations. while shifting smaller rects of images works well, larger, fullscreen rects always suffer from lag.
in the above code, myRect hosts a UIImage that is the size of the entire screen, and the animation will move it on to the screen from the left: {-480, 0, 480, 320}. if, however, myRect and the UIImage is smaller (a fourth the size of the screen), the animation is noticeably much smoother.
what causes this? is there a remedy? i'm assuming that the UIImage needs to be redrawn for each step of the animation, which causes larger images to animate less smoothly than smaller ones.
i've used apps and games where a scrolling background doesn't have a lag, even with many other forefront, smaller animations occurring simultaneously. i've been told it's because these apps use OpenGL instead of CA, but i though CA was like an OpenGL-lite that does the same thing but only accesses basic functionality of OpenGL? is it because one is rendering vector based images while my apps are animating bitmaps that need to be continuously redrawn?
Code:
[UIView beginAnimations:@"Animation" context:NULL];
[UIView setAnimationCurve:UIViewAnimationCurveEaseInOut];
[UIView setAnimationRepeatCount:FLT_MAX];
CGAffineTransform transform = CGAffineTransformMakeTranslation(480, 0);
[myRect setTransform:transform];
[UIView commitAnimations];
in the above code, myRect hosts a UIImage that is the size of the entire screen, and the animation will move it on to the screen from the left: {-480, 0, 480, 320}. if, however, myRect and the UIImage is smaller (a fourth the size of the screen), the animation is noticeably much smoother.
what causes this? is there a remedy? i'm assuming that the UIImage needs to be redrawn for each step of the animation, which causes larger images to animate less smoothly than smaller ones.
i've used apps and games where a scrolling background doesn't have a lag, even with many other forefront, smaller animations occurring simultaneously. i've been told it's because these apps use OpenGL instead of CA, but i though CA was like an OpenGL-lite that does the same thing but only accesses basic functionality of OpenGL? is it because one is rendering vector based images while my apps are animating bitmaps that need to be continuously redrawn?