Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Dark GDK / okay how do you put a image in a dark gdk game?

Author
Message
bushido
16
Years of Service
User Offline
Joined: 4th Jan 2008
Location:
Posted: 6th Jan 2008 17:44
Just wondering how you do this i see it on dark gdk 2d game template but I just do not get how to put in image in the file below readme.txt where it puts the image i am utterly baffled. Help is welcome!

i take karate hi-ya! (lol)
tempicek
16
Years of Service
User Offline
Joined: 27th Nov 2007
Location: Prague
Posted: 6th Jan 2008 18:03
First, you don't have to add the file there. The "Solution Explorer" shows files added to the project, but you don't have to add an image to a project. (it is not being compiled)

Second, you HAVE TO add the image file to the project folder on your drive, so that the executable has access to it. This has nothing to do with the solution explorer (as mentioned above).
bushido
16
Years of Service
User Offline
Joined: 4th Jan 2008
Location:
Posted: 6th Jan 2008 18:04
im confused about adding it to my drive or do you mean that i put it in the c:\ drive?

i take karate hi-ya! (lol)
bushido
16
Years of Service
User Offline
Joined: 4th Jan 2008
Location:
Posted: 6th Jan 2008 19:29
um okay now i got the image but i cant get it in the file here is the code

image is in the file do not understand why it wont load though

Real men don't need sigs
Comp Guru 910
16
Years of Service
User Offline
Joined: 23rd Dec 2007
Location:
Posted: 6th Jan 2008 21:37
OK, what you want to do is put it in the directory where all of your files for the project are stored. I told you this in a different post, which is about the same thing.

Find where your project files are stored on your computer, and put all your media into that folder. Or, you could even create a folder inside of that folder and put your media inside of it, and just tell the compiler to look for it there, hence C:\darkgdk\darkgdk-game-1\media\pic1.jpg

Thats an absolute path and you cant go wrong with that.

typos...
JBe
16
Years of Service
User Offline
Joined: 6th Jan 2008
Location:
Posted: 7th Jan 2008 00:47
I've had a similar problem while doing the first tutorial. Visual Studio usually creates a project folder with the *.sln file in it for you. Inside this directory should be another folder (named after your project) where your c-code is. You need to use this directory for your image or use an absolute path as Comp Guru suggested, then everything should work fine.
tempicek
16
Years of Service
User Offline
Joined: 27th Nov 2007
Location: Prague
Posted: 12th Jan 2008 22:42
Quote: "Find where your project files are stored on your computer, and put all your media into that folder. Or, you could even create a folder inside of that folder and put your media inside of it, and just tell the compiler to look for it there, hence C:\darkgdk\darkgdk-game-1\media\pic1.jpg

Thats an absolute path and you cant go wrong with that."


Actually I would never ever suggest absolute paths. Then the path for your project is fixed and you can not share it with anyone else (imagine you want your game to run on a mate's machine!).

Maybe it's good to note that you can set up the path in which your project is beeing ran by the Visual Studio when you hit F5 or Ctrl+F5. Just go to Project Settings | Debug | Run Directory (or something similar) - there you define the path when you want your project to be ran. You can use relative path here as well.

Login to post a reply

Server time is: 2024-10-08 15:56:00
Your offset time is: 2024-10-08 15:56:00