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.

Newcomers AppGameKit Corner / Cannot get sprite to display, only a checkerboard with a red X in the center (AGK2 C++)

Author
Message
RichBurb
14
Years of Service
User Offline
Joined: 28th Apr 2010
Location: The Dark Side of the Moon
Posted: 7th Jan 2016 19:11
I have tried putting my image in a multitude of different directories related to my project, but I cannot seem to get it to display. I only see a checkerboard with a red X. (image attached) Where do the image files need to be?
I am using Visual Studio 2010. I have been putting the image in the project directory (and tried all of the related directories.)

Attachments

Login to view attachments
blink0k
Moderator
11
Years of Service
User Offline
Joined: 22nd Feb 2013
Location: the land of oz
Posted: 7th Jan 2016 20:46
images need to be in a directory called "media" in your project directory. (this is for tier1, i'm assuming it's the same for teir2)
RichBurb
14
Years of Service
User Offline
Joined: 28th Apr 2010
Location: The Dark Side of the Moon
Posted: 7th Jan 2016 21:56
Thanks, but no. That did not work. Does anyone know where I can find some good tier 2 documentation?
Cybermind
Valued Member
21
Years of Service
User Offline
Joined: 28th Nov 2002
Location: Denmark
Posted: 9th Jan 2016 08:28
Some platforms, like Android, is case sensitive. So Image.jpg is not the same as image.jpg, PICture.png is not the same as picture.png When you put your images in your media folder then (as far as I recall) you don't put media in the path, use LoadImage(1,"image.jpg") to load the file image.jpg located in media folder. When you use a load media command, it automatically looks in the media folder. You can make sub folders in media folder, like "media/images/image.jpg", to load this you use LoadImage(1,"images/image.jpg"), again, you leave out "media" from the file path. Use forward slashes for seperators in file paths, AppGameKit will put the right seperator in the file path on the given platform, i.e. on Windows platforms, AppGameKit will put \ backward slash in file paths. If I have been unclear, feel free to ask
The byte chrunchers are coming...
DIVIDING BY ZERO/BECAUSE I SUCK...
FM77
9
Years of Service
User Offline
Joined: 6th Oct 2015
Location:
Posted: 10th Jan 2016 09:10 Edited at: 10th Jan 2016 09:24
After you compile, put the image or folder with images in your newly built folder of finished app "Final" or "Debug" instead of the project directory with template.sln.
A:\VS Project\Final //put files here inside new folder that contains your exe
blink0k
Moderator
11
Years of Service
User Offline
Joined: 22nd Feb 2013
Location: the land of oz
Posted: 12th Jan 2016 06:45
There are quite a few examples in C:\Program Files (x86)\The Game Creators\AGK\Projects\Native

Sign up for NaGaCreMo!
FM77
9
Years of Service
User Offline
Joined: 6th Oct 2015
Location:
Posted: 13th Jan 2016 01:30 Edited at: 13th Jan 2016 01:37
..Really? I don't have a folder named Native. I only see tier 1 examples in the projects folder. Searched root of agk for *.sln and *.cpp shows the platform templates for each OS.
blink0k
Moderator
11
Years of Service
User Offline
Joined: 22nd Feb 2013
Location: the land of oz
Posted: 13th Jan 2016 01:56
That was AGK1 not AGK2.
There are quite a few .cpp projects in there though.
Have you installed AGK1?
Maybe you could do that just for the examples
In the Native/Windows directory there are 58 projects including the sample games they have published

Sign up for NaGaCreMo!
FM77
9
Years of Service
User Offline
Joined: 6th Oct 2015
Location:
Posted: 13th Jan 2016 07:12 Edited at: 13th Jan 2016 08:44
Yeah ok,those are alright I guess. I thought I might have deleted something getting rid of showcase folder

I still use the agk editor alot, I can d/l it real fast if I am on the run and come up with an idea,
it's nice and light for netbooks when I delete the tier 2 & projects folders to save space
instead of carry around all those platform

You can change language tab to C++ on the documentation pages and it has the examples page too!
https://www.appgamekit.com/documentation/examples.html

Login to post a reply

Server time is: 2024-11-21 21:15:28
Your offset time is: 2024-11-21 21:15:28