We are about to switch to a new forum software. Until then we have removed the registration on this forum.
Hi,
My 'data' folder consist of a number of different items including textfiles, .vlw files for font, and different sets of images. Is there any way of how such files can be organised in folders within the 'data' folder and can be still accessed when for example using the loadImage() or loadFont() methods?
Thanks.
Answers
What happened when you just added a directory and put the directory name in front of the file name?
Use
dataPath("folder/file_name.ext")
. Some examples:loadImage(dataPath("images/sprite01.png"));
saveFrame(dataPath("backgrounds/bg-####.jpg"));
loadFont(dataPath("fonts/LetterGothicStd-32.vlw"));
P.S.: dataPath("") can be omitted when loading. But it's needed when saving! 8-}
Therefore
loadImage(dataPath("images/sprite01.png"));
can simply be:
loadImage("images/sprite01.png");
But
saveFrame(dataPath("backgrounds/bg-####.jpg"));
should rely on dataPath("")! :-\"Hmmm that pretty basic stuff but I didn't know it can be done that way! Big thanks both of you :)