MovieClip / SpriteSheet (optimization)

Hello!

I have an animation of 50 images with “movieClip” library because with a “spriteSheet” library I can’t fit these image to screen, it’s displays too small…

But, with movieClip and 50 images in the animation consumes a lot of memory.
How I can optimize an animation with movieclip library to consume few memory and size of app.
Sorry for my english! :stuck_out_tongue:

Thanks! [import]uid: 93601 topic_id: 17462 reply_id: 317462[/import]

i dont understand problems with spriteSheet, its basically advanced version of movieClip [import]uid: 16142 topic_id: 17462 reply_id: 66231[/import]

It’s easy, if you use a sprite sheet of an animation with a lot of moves, this sprite it will show too small!!

[import]uid: 93601 topic_id: 17462 reply_id: 66236[/import]

I’m not understanding either
maybe post some code/images [import]uid: 7911 topic_id: 17462 reply_id: 66242[/import]

I’d like to see some code and images too - the size of the sprite shouldn’t change. [import]uid: 52491 topic_id: 17462 reply_id: 66394[/import]

It’s easy but maybe didn’t understand me with my bad english :frowning:

I have a flash animation with some movements, that if I cut in parts there are 50 images (photograms)

If I create with these images a spriteSheet, the animation it will see too small because there are a lot of images to complete the animation in sprite’s PNG image, but If I put like a movieClip I can set the original size of image with great image quality because each image has the original size (for example 200x500)

I do this because I’m interested to fit the animation at screen without losing image quality. (If I use a spriteSheet the only way to increase is scaleX and scaleY with losing quality of image)

[lua]animation = movieclip.newAnim({
“animation01.png”,
“animation02.png”,
“animation03.png”,
“animation04.png”,
“animation05.png”,
“animation06.png”,
“animation07.png”,
“animation08.png”,
“animation09.png”,
“animation10.png”,
“animation11.png”,
“animation12.png”,
“animation13.png”,
“animation14.png”,
“animation15.png”,

“animation50.png”});[/lua]

Now my question is if there are any method to optimize an animation made by movieClip ?

Thanks!
¡Gracias! :wink:
[import]uid: 93601 topic_id: 17462 reply_id: 66406[/import]

So wait - what you mean is that you’re making a small sprite sheet because it will go over the size limit otherwise? Corona isn’t resizing anything?

With 50 images at 200x500 a lot of memory would be used, yes. Multi sprite sheets might be a bit better, although that many images at that size is never going to be light on memory usage.

Peach [import]uid: 52491 topic_id: 17462 reply_id: 66411[/import]

But with sprite sheets if the max size PNG is 2048x2048 the animation will be too small in there.

When I display at device I need to scale with scaleX and scaleY to fit at screen but lose a lot of quality.

I put an example with an image of Internet:

I would like to display an animation, I use movieClip to fit at screen, the problem is that the animation has 50 photograms, but it seen like this:

(made with 50 images in newAnim function with movieClip library)

Why I didn’t use spritesheet?
Because If I create the PNG sprite sheet (with 2048x2048)…

Later, at the moment to display in device it seen like this:

(made with the original spriteSheet)

When I scale it to fit at screen lose a lot of quality:

(made with the original spriteSheet scaled to screen)

My question is how I can optimize movieClip library or how is the better option to display an animation in original size (big size, fit to screen)

Thanks!
¡Gracias!
[import]uid: 93601 topic_id: 17462 reply_id: 66421[/import]

what is the file size of your images
what are you using to save them [import]uid: 7911 topic_id: 17462 reply_id: 66436[/import]

36,8kb for each image (.PNG format)

I saved with Adobe Photoshop in “Save for web and device”.

(I’m not a newbie in this cases, I’m a web developer :P) [import]uid: 93601 topic_id: 17462 reply_id: 66463[/import]

I wasn’t suggesting that but…
if you run your images through this it will shave some more off your images
http://imageoptim.pornel.net/ [import]uid: 7911 topic_id: 17462 reply_id: 66465[/import]

Thanks! but I read that isn’t on Windows yet.

I’m a windows xp user [import]uid: 93601 topic_id: 17462 reply_id: 66498[/import]

Your best option would be using mp4 video…

Or if your animation is suitable for that, you may go hybrid… Lets say the figure in your sample just stands there and talks… Use a single stationary body image and put mouth animation in a sprite sheet…and overlay…

Another option might be (just an untested idea), make that an animated gif and display it using a web popup…

:slight_smile: [import]uid: 10478 topic_id: 17462 reply_id: 66504[/import]

Thanks for support.

My question now is if there are any method to load images before animation?

I have 5 animations (5 characters with moves in aproximately 30 images for each) scrolling when I click with finger.

When I pass characters It takes a bit to load.
Here some lines of code with function that loads and play the animation:

[lua]local function seeChar(num)
– If not first character delete the animation before starts next animation
if(element[“num”] > 1) then
animation:stop();
animation:removeSelf();
end

if(element[“num”] == 1 and num == 1) then
animation = movieclip.newAnim({
“image01.png”, “image02.png”, “image03.png” […], “image30.png”});
animation:play(30);

elseif(element[“num”] == 2 and num == 2) then
–[…] CHARACTER2 and later three more characters […]

end
animation.x = display.contentWidth/2;
animation.y = display.contentWidth/2.3;

elemGroup:insert(animation);

– function with transition effect
start();

end[/lua]

When I slide the first character the app increase [lua]element[“num”][/lua] and go to [lua]seeChar(2)[/lua]

The same process to the other 3 characters.

(Sorry for my bad english!)

Thank you everybody
Gracias a todo el mundo! [import]uid: 93601 topic_id: 17462 reply_id: 67509[/import]

I solved the problem correctly!!

I’ve create loading images function before the execution of animation.

I load all images before the start of app content and runs alright!
:slight_smile:
Un saludo! [import]uid: 93601 topic_id: 17462 reply_id: 67735[/import]