- Home /
load images in sequence into a gui?
Hi
How can I load images from a folder into a gui in sequence (each frame one). Theres about 600 images. Can I use for that TextureImporter? When yes how, I havent got many experience with that.
Thanks.
Answer by Tommy · May 20, 2011 at 07:55 PM
You can make it easy and name the files like "name001.jpg", "name002.jpg"..."name600.jpg" and maybe do something like this:
var imgNumber = 1;
function Update()
{
loadAndSetTexture "name"+imgNumber;
yield loadAndSetTexture;
imgNumber + 1;
}
Note that you'll have to create coad to load the img and set is as texture, i'm not on my computer so can't do that code for you. But you can use WWW for it. Like WWW "file:///the/local/path"+imgNumber. Prettey simple.
Answer by realm_1 · May 20, 2011 at 08:27 PM
Yeah ok its a good idea but I/we found also an other solution: http://forum.unity3d.com/threads/90034-load-folder-into-texture2D-array
But your idea is also good. Thanks
actually his comment is a valid answer :) it should only be marked as answer maybe ;)
Your answer
Follow this Question
Related Questions
How do i load entire folders into arrays? 2 Answers
www not loading from image file 3 Answers
Possible to load image from desktop not url 3 Answers
Using an IEnumerator to return another type of variable 1 Answer
AssetDatabase current folder? 2 Answers