Go Back   CodingForums.com > :: Client side development > JavaScript programming > JavaScript frameworks

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 12-19-2011, 06:00 PM   PM User | #1
Ingridia
New to the CF scene

 
Join Date: Dec 2011
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Ingridia is an unknown quantity at this point
Question Animation in JS

Hello,

One of my friends asked me if is possible to read png files and show them as a film (animation). As I know I should to read and show about 25 files per second to make it smooth.

I know how to read files, and show them. But how to read them all before I start to show them? It is hard to read and show 1 png per second, I think 25 is not possible... so I need to preload them...

OK I don't have any idea how to solve this...
Ingridia is offline   Reply With Quote
Old 12-19-2011, 06:20 PM   PM User | #2
nuBee
New Coder

 
Join Date: May 2011
Posts: 43
Thanks: 8
Thanked 0 Times in 0 Posts
nuBee is an unknown quantity at this point
Sprite sheets....

All your png images on 1 image in a line equally spaced as "frames", then you change the offset sliding the image x or y 1 frame multiple times/second. When it gets to the end it starts over or shifts down a row and keeps running depending on how many sprites you're using...

Solves your other problem of waiting until all images are loaded and it cuts down on calls for images.

Here's a tutorial using jquery http://www.darian-brown.com/2d-sprit...tion-tutorial/

Last edited by nuBee; 12-19-2011 at 06:28 PM..
nuBee is offline   Reply With Quote
Reply

Bookmarks

Tags
animation, javascript

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 08:27 PM.


Advertisement
Log in to turn off these ads.