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.

Android / AGK2 on Android (some) images not loading

Author
Message
Abiz
11
Years of Service
User Offline
Joined: 14th Nov 2012
Location: Amsterdam
Posted: 25th Nov 2015 03:41 Edited at: 25th Nov 2015 03:53
I would love some suggestions on this one:

1. Build a game on v1.08, just installed v2.0.15 and migrated everything (lots of errors, my goodness )

2. Created an android build, had to fiddle with some upper / lowercase mess, but finally got everything right.

Now if you look at the attached image, you see that some images are not loading. I checked the obvious upper / lowercase, and it doesn't apply.
I checked if all the files were in the asset folder and they are.

The pre-load images and assign image to sprite routines are all common, so work entirely the same for all sprites.
Some images don't display right from the beginning, other fail when I change the sprite image. (by the way, if I use the SetSpriteImage( sIndex, iIndex, 1) then I get hickups in the rendering, like it is recalculating all collisions, so back to 0 as it was before)

On the attached image you see on the right the word default. (That is the highlighted state) the 3 images below there are other targeting options. The highlighted version works, the non-highlighted one doesn't.
In other sprites is exactly the other way around...... [O tested on phones and tablets, missing images are all the same every time so it is not the device )

Additional info: I use only PNG images, and screen shot is from my phone.

Any hint or clue is much appreciated. Other than that I'm rather happy. Have to figure something out with inputbox and data save. The User Preferences do save, but the data from the input box doesn't. (Weird)
I will build a test program to test that further, so don't worry about that one yet.

Guys the Android build is truly amazing, love love love it.
Have not tested version 2 further than that, but I'm going to have fun.

Thanks,
James

Attachments

Login to view attachments
Abiz
11
Years of Service
User Offline
Joined: 14th Nov 2012
Location: Amsterdam
Posted: 25th Nov 2015 17:30 Edited at: 25th Nov 2015 17:44
Additional information:
I build in this check : Message( "Image Index is " + str(gt00_iID) + " and IMAGE[].ID = " + str(IMAGE[gt00_iID].ID) + " And image exists: " + str(GetImageExists( IMAGE[gt00_iID].ID )) )

I store all relevant Image information in an ARRAY IMAGE, including the ID assigned by the system (100029 on both windows and Android) right before I do SetSpriteImage!
And the answer is every time 18 100029 1 (in other words, image 100029 does exist at that moment of time)

I have also build in the following extra code during pre-load:
filename$ = "gt00.png"
subdir$ = "img"
if GetFileExists( subdir$ + "/" + filename$ ) = 0
message("Cannot find file " + subdir$ + "/" + filename$)
endif

and I get no message to pop up.

I'm lost for words....


PS. I also added this GetImageFilename(IMAGE[gt00_iID].ID ) and it comes back with "img/gt00.png" exactly as expected, but it still draws a MISSING image picture.....
Abiz
11
Years of Service
User Offline
Joined: 14th Nov 2012
Location: Amsterdam
Posted: 25th Nov 2015 18:49
Solved it:
The original picture with which I drew the sprite was 24-bit. The replacement pic was gray-scale 256 colors. When I changed that to 24-bit as well, it worked fine .....
Freddix
AGK Developer
21
Years of Service
User Offline
Joined: 19th Sep 2002
Location: France
Posted: 5th Feb 2016 21:09
I encountered a problem witt loadimage too...
The problem was located to the file media/bytecode.byc created when using "Build->Compile" menu.
I had to delete the file (it contain media filenames), recompile and then export to Androïd ..
It fixed my issue with loadimage....
JacobVR
8
Years of Service
User Offline
Joined: 19th Feb 2016
Location:
Posted: 19th Feb 2016 21:19
Im assuming the app your having issues with is one you have made yourself in AppGameKit v2. If so, can you just open one of the examples which came wit AppGameKit v2 and export that to an APK and see if that works on your device? lets figure out if its your app thats the issue, or the export of any app from the editor thats the issue. Also do you have another android device to try this on, to see if its your device thats the issue. Lets try and isolate whats causing this.

Login to post a reply

Server time is: 2024-03-29 08:51:53
Your offset time is: 2024-03-29 08:51:53