Hello all,
I have made a helper function which is very much like the one mentioned here:
http://forum.thegamecreators.com/?m=forum_view&t=169275
Unfortunately it doesn't seem to work. My code:
int getFreeImageID()
{
int nID = 0;
while (dbImageExist(nID) == 1)
nID++;
return nID;
}
And it is used here:
nImageID[0] = getFreeImageID();
dbLoadImage("GUI/TileListFrame.png", nImageID[0]);
nImageID[1] = getFreeImageID();
dbLoadImage("GUI/ScrollArrowUp.png", nImageID[1]);
nImageID[2] = getFreeImageID();
dbLoadImage("GUI/ScrollArrowDown.png", nImageID[2]);
nImageID[3] = getFreeImageID();
dbLoadImage("GUI/Scrollbar.png", nImageID[3]);
getFreeImageID returns the value 0 every time, not only the first time it is called. Does anyone know why? Am I doing something wrong, or is dbImageExist bugged? (And yes, I'm trying to make a GUI element with a scrollbar, made of seperate .png files.)