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.
IndexProgramming Questions & HelpSyntax Questions › placing multiple images in loop
Page Index Toggle Pages: 1
placing multiple images in loop (Read 1038 times)
placing multiple images in loop
May 27th, 2010, 1:07pm
 
I'm trying to create an image which loads the same image based on GPS data in XML. I know how to do this with AS3--- just add a new child from the library. But I haven't yet figured out how to do this with Processing. I'm thinking that I need to copy image, but have only succeeded in copying one. Do I need an array? Recursion? Help?


  Code:
for (int i = 0; i < times.length; i++) {/
     
      String latStr= lat[i].getContent();
      String [] latArr=split(latStr, ".");
       
       int latArr0= PApplet.parseInt(latArr[0]);
       int latArr1= PApplet.parseInt(latArr[1]);

   
         ///attempting to load
         //needs an array to load all?
         PImage latImg;
         latImg= loadImage("one.jpg");//tester
        image(latImg,latArr0,latArr0);//testing
        latImg.copy(latArr0, latArr0, 30, 100, 200,latArr0+i, 50, 100);
         image(latImg, 0, 0);
} etc....

                     
Re: placing multiple images in loop
Reply #1 - May 27th, 2010, 1:47pm
 
Actually- nevermind. I passed the int to a different function and had it copy the image there. Worked like a charm.
Page Index Toggle Pages: 1