Sunday, 15 February 2015

objective c - iPhone animation efficiency solutions, layering questions -


I'm working on writing a basic app. It uses minimal touch input, and most fancy games play animation. There is not much animation, but the way it is currently done is extremely inefficient and uses a lot of memory.

This scene is divided into two parts, below 1/5 only There is an image that never changes. This is the rest where the animation plays. It is currently loading 32 images in one array and then running through them (8 FPS). This goes 4 times through each animation Photos are not very big, but they are still big. I was also thinking that to store them as the best file format, both according to the overall size and requirement of the overhead.

This is a simple straightforward approach, and it works, but it does not seem to be remembered, it uses too much.

My suggestion was to split the animation into some layers, because there are some things that can be done differently:

  • Make the background a static image, therefore It does not have to be a part of the animation.
  • Excluding some "dude", such as graphs and running a progress bar and making them partially transparent layers up or down, the animation will also open the door Till the creative self Ntrta is in the future for me.
  • Exclude the above text and use the iPhone to display the text instead. Is it better to drag an image or load an image with text in the iPhone? Mainly being a web god, I find it silly to load any image.
  • What is left after these things are taken out as an animation, which will be very small

So overall, we have 1 static background, 3 -5 are looking at small animations, and a big one. Can I use layers to separate these elements, and is it more dependent on the iPhone to attract the final image? This was the place where I thought I could make this race a little better, it seems silly to merge into a bigger picture, so that you can flip like a flip book, when you're in the app-wide Can load some small elements, and do things a little bit more efficiently

Or, am I completely fulfilling it and there is a better way to go about it?

EDIT: I am browsing around and it seems that using layers will be more efficient. I have another question, though. As each frame of the animation it is better for its file, and has been loaded into the array for animation, or is a huge phantom sheet image with all the frames, and using the coordinates of the iPhone from within the phantom sheet Is it better to capture each frame as a program? <2 p>

Edit 2: We've done everything since then,

< P> Assuming that the total animation sequence is stable, you want to compile it as the best movie, and use the Movie Player Framework to play it:

  MPMoviePlayerController  

This will allow the iPhone to use custom hardware for display, and the use of the battery will be less. As a user interaction, you need to set Movie Controlmode property so that the user is not able to interact with the movie.

MPMovieControlModeHidden Do not display any control This mode prevents users from controlling playback.

Available in iPhone OS 2.0 and later.

declared in MPMoviePlayerController.h.


No comments:

Post a Comment