We closed this forum 18 June 2010. It has served us well since 2005 as the ALPHA forum did before it from 2002 to 2005. New discussions are ongoing at the new URL http://forum.processing.org. You'll need to sign up and get a new user account. We're sorry about that inconvenience, but we think it's better in the long run. The content on this forum will remain online.
Page Index Toggle Pages: 1
Animation (Read 2632 times)
Animation
Oct 24th, 2005, 12:31am
 
Hi, I am a new user for processing. this is my 1st form here. I have a problem by creating the animation. Any helpS? I have set up the normal class of animation. but it's doesnt work.
Re: Animation
Reply #1 - Oct 24th, 2005, 11:27am
 
Rachel,

Welcome on board.

It's difficult to help if we don't know what you want to animate. Can you describe it in more detail. You could also post your code or provide a link to an example.

Instructions on how to format code can be found here.
Re: Animation
Reply #2 - Oct 24th, 2005, 5:33pm
 
i have create a shooting game on processing.
however, I have read the example from the site called 'anitmation spite'. I have really confuse about the code as the following:

class Animation
{
PImage [] ani;
int frame;
int numFrames;

//framecount contains the no. of frmaes since the program started.
Animation (String imageName, int frameCount)
{
 numFrames = frameCount;
 ani = new PImage[numFrames];
 loadImages(imageName);
 }
 
 void loadImages (String name)
 {  
   for (int i=0; i<numFrames; i++)
   {
    String imageName = name + ((i<10) ? "0" : "") + i + ".jpg";
    ani[i] = loadImage(imageName);
    }
    }
    int getWidth()
    { return ani[0].width;}
    }
   


Re: Animation
Reply #3 - Oct 24th, 2005, 5:48pm
 

What's the confusion? Is there a problem with this code?
Re: Animation
Reply #4 - Oct 24th, 2005, 11:18pm
 
It's still hard to imagine where you've got a problem. I'm making a wild guess here: do you want to use animated GIFs to display explosions in your shooter game? It might be good to know how you've initialized them and when they are displayed. Can't you post the whole program?
Or maybe I'm all wrong and you want a very specific explanation of something?
Re: Animation
Reply #5 - Nov 6th, 2005, 8:02pm
 
yes.
I have tried to load the image for my game. however, the error message is always said:
java.io.Exception: openStream() could not open 12lidback00.gif...
when i loaded the image, i wrote something like  
----> animation1 = new AniSprite("12lidback", 38);  <----
is there i has a problem for the arguement of load image?
Re: Animation
Reply #6 - Nov 7th, 2005, 3:29pm
 
have you added that image to the sketch?
Re: Animation
Reply #7 - Nov 7th, 2005, 3:40pm
 
yes.. i did.. i have add the picture in the 'data' file directary in my sketch file.. that's why i dunno where is the problem is.
Page Index Toggle Pages: 1