Author |
Message |
kartikitrak
|
Posted: Wed Jan 12, 2011 2:48 pm Post subject: Folder Picture Output |
|
|
How do you output all the pictures in a specific folder?
Basically I want to show a list of all my maps that are in a folder, however I don't know how. It's like Call of Duty when you are selecting a map.
If possible, just a list of all the filenames are good,too.
Also the folder may be updated at anytime and I would like to keep the list updated. |
|
|
|
|
|
Sponsor Sponsor
|
|
|
Tony
|
|
|
|
|
kartikitrak
|
Posted: Wed Jan 12, 2011 3:35 pm Post subject: RE:Folder Picture Output |
|
|
you have made me feel like an idea... THANK YOU! : ) |
|
|
|
|
|
kartikitrak
|
Posted: Wed Jan 12, 2011 3:42 pm Post subject: RE:Folder Picture Output |
|
|
I have tried using the dirmodule however I am just wondering if it will allow you to output all the pictures in the folder. |
|
|
|
|
|
Tony
|
Posted: Wed Jan 12, 2011 3:44 pm Post subject: RE:Folder Picture Output |
|
|
It provides the tools for you to find out what all the files in the folder are. You can use file name endings to figure out if those files are pictures or not, and once you have the name of the pictures, you can do whatever you want with them. |
Tony's programming blog. DWITE - a programming contest. |
|
|
|
|
kartikitrak
|
Posted: Wed Jan 12, 2011 3:51 pm Post subject: RE:Folder Picture Output |
|
|
i still don't really get it.
So how to i get the pic.draw feature to use the filenames listed in the screen |
|
|
|
|
|
Tony
|
|
|
|
|
kartikitrak
|
Posted: Wed Jan 12, 2011 3:57 pm Post subject: RE:Folder Picture Output |
|
|
but does filename represent only one file or the whole list
if it represents one how would you pic.filenew the others
also if it represents the whole list would u just need
pic.filenew (filename) |
|
|
|
|
|
Sponsor Sponsor
|
|
|
Tony
|
Posted: Wed Jan 12, 2011 4:00 pm Post subject: RE:Folder Picture Output |
|
|
No, Pic.FileNew take one name at a time. To go over all of the names, you'd need some sort of a loop. |
Tony's programming blog. DWITE - a programming contest. |
|
|
|
|
kartikitrak
|
Posted: Wed Jan 12, 2011 4:01 pm Post subject: RE:Folder Picture Output |
|
|
anyway..i tried with just one picture but i gives me a illegal picture id number 0
var streamNumber : int
var fileName : string
var dir : string
dir := Dir.Current + "/usermaps"
streamNumber := Dir.Open (dir)
assert streamNumber > 0
loop
fileName := Dir.Get (streamNumber)
var pic : int := Pic.FileNew (fileName)
exit when fileName = ""
put fileName
Pic.Draw (pic, 0, 0, picCopy)
end loop
Dir.Close (streamNumber) |
|
|
|
|
|
Tony
|
Posted: Wed Jan 12, 2011 4:03 pm Post subject: RE:Folder Picture Output |
|
|
What is the fileName that it tries to open? Is there such a file in the _current_ directory? |
Tony's programming blog. DWITE - a programming contest. |
|
|
|
|
kartikitrak
|
Posted: Wed Jan 12, 2011 4:05 pm Post subject: RE:Folder Picture Output |
|
|
My current directory
/Game
listprogram.t(this is the program)
/usermaps/pic1,pic2 |
|
|
|
|
|
kartikitrak
|
Posted: Wed Jan 12, 2011 4:05 pm Post subject: RE:Folder Picture Output |
|
|
Do you have an msn. So we can talk via msn. |
|
|
|
|
|
Tony
|
Posted: Wed Jan 12, 2011 4:06 pm Post subject: RE:Folder Picture Output |
|
|
Yes. When you get the illegal picture ID error, what value does fileName have at that time? |
Tony's programming blog. DWITE - a programming contest. |
|
|
|
|
kartikitrak
|
Posted: Wed Jan 12, 2011 4:07 pm Post subject: RE:Folder Picture Output |
|
|
if you didn't get the folder...
the directory that everything is in is: Gane
in that folder there is one folder named usermaps and the turing file.
the turing file is trying to read and output the pictures in the usermaps folder. |
|
|
|
|
|
|