On 15 Nov 2007, at 10:56, Paul Rutten wrote:
I am working on a study with tiled images. In a folder on my desktop
are 255 tiles in jpeg pictures named 1.jpg - 255.jpg, 15 rows and 15
columns.
I use two iterators and a sprite fed with size and position values
deducted from the iterators loop positions.
The composition displays only image 1.jpg in all instances of the
sprite. The file path is also constructed with the iterator variables.
How can I get the iterators to wait for the image downloader?
(If I use an image from the image with string patch, generating a
number, it works.)
Any ideas?
You are seeing the 1st image in every position because for each
iteration, the downloader is getting a new URL, and because it takes
some time to load each image, it never has a chance to finish and set
the "Done Signal" to TRUE before the next iteration kicks in. You need
to consider that an iterator doesn't duplicate it's subpatches, it
just runs through all the iterations in a loop (this is fundamental to
understanding an iterator).
I'm doing a similar thing with a folder full of images but the only
way I've found effective is to separate the Image Downloader
functionality from the rendering iterator. I use a JS patch to loop
through the contents of a Directory Scanner, getting a single
Downloader to load each image. When the image is loaded, it triggers
the same JS patch to add it to the required element of an array and
move onto the next image. When the array is filled, I publish that as
a __structure and pass that to my rendering iterator, which only needs
to be 1 dimensional since my array is 1 dimensional. I do some other
things with the array like add coordinates for each element and some
metadata too although that's not really necessary, it just makes
encapsulating your data a bit cleaner.
You might run into the Z-depth problem discussed in another thread if
you do this however, since an iterator won't respect the Z-order of
your sprites, it'll just run through that array in the order they
appear (or were loaded). Maybe that's not a concern for a mapping type
application as you're doing.
Hope that helps,
Ade.
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Quartzcomposer-dev mailing list ([email protected])
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/quartzcomposer-dev/archive%40mail-archive.com
This email sent to [EMAIL PROTECTED]