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 / Assets? Media? Where DO I put my images so they work in my .apk?

Author
Message
ChasDGreen
12
Years of Service
User Offline
Joined: 25th Sep 2012
Location: Rotherham, UK.
Posted: 1st Oct 2012 10:14
I've looked in the FAQ. I've trawled the forum. I've watched the videos but STILL, it seems, wherever I put my images, the sprites that work fine in the AppGameKit Player appear in my compiled .apk, as a chequered black and white sprite, with a red cross in the middle. Obviously, the program isn't finding the image (which IS in .png format).
I've put them in /assets, in assets/media, even in the root of my project folder but nothing seems to work. Can anyone, please, help me with a definitive, current, version of where to put the image files to make my program work?
Rich Dersheimer
AGK Developer
15
Years of Service
User Offline
Joined: 1st Jul 2009
Location: Inside the box
Posted: 1st Oct 2012 12:24
I believe they go in assets/media. One thing to check... The file names must match EXACTLY, case counts.

"graphic.png" does not equal "Graphic.png"

MarcoBruti
13
Years of Service
User Offline
Joined: 20th Nov 2011
Location: Caput Mundi
Posted: 1st Oct 2012 12:26
Beware of the file name: Android, as all Linux/UNIX systems, are case sensitive.
If the file name is "image.PNG", and in the code you use
,
you shall get a beautiful "X" to show that the app cannot find the image,because PNG<>png for the File System.
About the correct folder, put the media files into the media folder or subdirectories, using relative path to address the files.
Ancient Lady
Valued Member
20
Years of Service
User Offline
Joined: 17th Mar 2004
Location: Anchorage, Alaska, USA
Posted: 1st Oct 2012 17:43
Yup, they covered it all.

Images go in <yourandroidproj>/assets/media. The one exception is the AGKSplash.png file. If you are using one, it goes in the assets directory.

And make sure that you are consistent with case. It needs to be exactly the same in the code as it is in the media directory.

Cheers,
Ancient Lady
AGK Community Tester
Van B
Moderator
22
Years of Service
User Offline
Joined: 8th Oct 2002
Location: Sunnyvale
Posted: 1st Oct 2012 17:56
Can we just have a 'Media' folder with our project files, and have everything inside that?

Seems to do the trick for me - wondering if there's some automatic setup with that, like it takes the media folder and adds it to your assets. I've been adding a media folder to my projects and assuming that's all that's required .

Health, Ammo, and bacon and eggs!
Ancient Lady
Valued Member
20
Years of Service
User Offline
Joined: 17th Mar 2004
Location: Anchorage, Alaska, USA
Posted: 1st Oct 2012 18:03
Van B, what version of AppGameKit are you working with? And have you updated your Android directories to have the same (current? 1076) version?

I had thought the same thing, then I updated my AppGameKit and was not able to just have a <androidproj>/media directory.

Also, for Android builds using the make files and such supplied, it won't include <android>/media in the built apk file. There might be ways to add it in the .mk files or the Eclipse IDE.

For the Windows builds, all you need is <yourwinproj>/media and it is fine.

Cheers,
Ancient Lady
AGK Community Tester
ChasDGreen
12
Years of Service
User Offline
Joined: 25th Sep 2012
Location: Rotherham, UK.
Posted: 2nd Oct 2012 12:31
Thanks, Guys.
Feel like a real dummy.
Just the difference between image.png and image.PNG !
I didn't even realise that my paint program had saved it with the file extension in caps, until I went looking for it..

Ancient Lady
Valued Member
20
Years of Service
User Offline
Joined: 17th Mar 2004
Location: Anchorage, Alaska, USA
Posted: 2nd Oct 2012 16:31
It happens to the best of us. I can't count the hours I've spent trying to debug something and it turned out to be a single character wrong or missing. This is the world of programming. Have fun!

Cheers,
Ancient Lady
AGK Community Tester

Login to post a reply

Server time is: 2024-11-23 23:49:27
Your offset time is: 2024-11-23 23:49:27