No pictures on device

Monkey Targets Forums/Android/No pictures on device

Alex(Posted 2011) [#1]
I build successfully, but when I run the app on the device, it shows no pictures (I can sometimes see a colored rectangle, where the image is supposed to be, but that's it). Any advice?


degac(Posted 2011) [#2]
What are the type and size of pictures? Jpg, Png are the only valid format supported.


Alex(Posted 2011) [#3]
pics are jpg, 350x489 pixels


degac(Posted 2011) [#4]
It seems a problem of power of 2: try to resize/change the canvas the image to something like 352x512 (it should be the nearest size)


MikeHart(Posted 2011) [#5]
Power of 2:

2,4,8,16,32,64,128,256,512,1024,....


Alex(Posted 2011) [#6]
resized to 183x256. Nothing changed


Xaron(Posted 2011) [#7]
The pathes are correct? It is case sensitive as well so image.png should be different to Image.PNG


Alex(Posted 2011) [#8]
yes. paths are correct.

I figured that if I draw an image in OnRender - image is drawn correctly.
And if I draw in a method call (called in OnRender) - no render occurs.


Xaron(Posted 2011) [#9]
Did that work in earlier versions? And could you post a simple example including that image?


Alex(Posted 2011) [#10]
I figured what the problem was. Seems that extending a class does not always work properly (Or maybe its just me not getting the point)

I had a DisplayObject class, with an empty OnRender method. I also had a Sprite class that extended DisplayObject and had a non-empty OnRender method of its own (It didn't overload the DisplayObject's method, since it had the same parameters - none). A class that extended Sprite inherited the DisplayObject's OnRender Method, not Sprite's, as I suggested.

It did work in HTML5 target, but not on iOS or Android.