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.

AppGameKit Classic Chat / Issues Loading Image

Author
Message
Superdeath360
13
Years of Service
User Offline
Joined: 23rd Nov 2010
Location:
Posted: 22nd Jan 2012 23:14
Er....I'm trying to use App Game Kit with Visual Studio 2010, And when I try load an Image, it doesnt appear on the sprite it is assigned to. Instead, the sprite has a default error image. I've put the image I'm trying to use in the project folder, and in a folder titled media within the project folder...I feel very stupid



herp derp
LeeBamber
TGC Lead Developer
24
Years of Service
User Offline
Joined: 21st Jan 2000
Location: England
Posted: 27th Jan 2012 00:11
Try loading one of the T2 Windows examples that loads an image, and cut it back until your code resembles what you posted above. Reverse engineering something that works until you break it is a great way to learn the ins-and-outs of a new language and development kit. You can then compare like for like your current project and the template, and the differences will pretty much jump out at you (including the answer to your question). Good luck!

I drink tea, and in my spare time I write software.
Greg_C
13
Years of Service
User Offline
Joined: 22nd May 2010
Location:
Posted: 27th Jan 2012 00:22 Edited at: 27th Jan 2012 00:29
I had this problem and I am not to sure if this will help but the image loads based off the exe of your project. So I made my project here C:\Games\MyGame

In the folder "MyGame" there are 2 folders another "MyGame" Folder and then a debug folder. In that folder there is an exe it should be called YourGameName.exe This is where you would want to put your images. Now this is where the exe for my project is, could be different for you and with VS 2010. I am using VS 2007 (So just look for it in your project folder should be there). If you want to have a folder where you put all your images in then you will have to give the path. for instance in the "MyGame" Folder I have another folder called "Source". So my path to my images looks like this

agk::LoadImage("..\\Source\\Box.png");

So basically from the exe I am then going up a directory ("..") then I am going into the "Source" folder and getting my image.

If all this is correct and I just gave you useless information then sorry =/

Login to post a reply

Server time is: 2024-05-04 23:15:03
Your offset time is: 2024-05-04 23:15:03