Page 1 of 1

Gui image does not load(SOLVED)

Posted: Wed May 28, 2008 8:34 pm
by 3DModelerMan
Hi I have been working on a main menu for my game,
It has an image in the background, but when I try to load my image
it won't work I get this error on the console window

Code: Select all

Cannot load file .../.../.../Pingy3,/gui/bkg.bmp
I am new here so, could be a beginers mistake, but I checked the path to the file like a dozen times and could'nt get it to work... um here's my code

Code: Select all

   guienv->addStaticText(L"Welcome to Pingy world!!!",
        rect<int>(5,4,250,25), true);
   //add the buttons
    guienv->addButton(rect<s32>(25,210,150,240), 0, 101, L"Play.");
    guienv->addButton(rect<s32>(25,250,150,280), 0, 102, L"How to play.");
    guienv->addButton(rect<s32>(25,290,150,320), 0, 103, L"Quit...");
    //add an image
    guienv->addImage(driver->getTexture(".../.../.../.../pingy3,/gui/bkg.bmp"),
    position2d<int>(10,10));
Does the

Code: Select all

 driver->getTexture 
Function corespond to any variable that might have a different name?.Or (I use code::blocks IDE) do I have to set some working
directory thing different?.

Thanks.

Posted: Wed May 28, 2008 8:45 pm
by hybrid
I'm not sure if a "," character is allowed in filenames. But it could also be the typical MSVC wrong working dir error.

Nope does'nt work.

Posted: Wed May 28, 2008 11:17 pm
by 3DModelerMan
I tried it both It actualy prints this (I got my message wrong)


Cannot open file of texture.../.../pingy3/bkg.png


I changed to png.

Posted: Thu May 29, 2008 6:28 am
by radical-dev
Hi!
.../.../.../.../pingy3,/gui/bkg.bmp
if the points should go up one directory, try only 2 point like this:

Code: Select all

../../../../pingy3,/gui/bkg.bmp
Dunno if this solves your problem.

Greetings

Posted: Thu May 29, 2008 8:12 am
by hybrid
Uh, that's an even better hint on forbidden file access techqniues :lol: I really didn't spot that one.

Posted: Thu May 29, 2008 9:51 am
by radical-dev
Hehe :lol: