I’m trying to port my last game to android (I came from kobold2d), and I’m having problems loading a texture within android.
I use xcode for porting the game (I know how to debug, and it’s easy to me than eclipse). I set up correctly a helloworld example, compile under xcode, and run succesfully under iphone simulator and android device (compiled with build_native & ran with eclipse).
But I’m having problems loading a texture “created with texturePacker”, under iPhone simulator everything runs fine, but under android, the game does nothing. (And I don’t know how to debug), the game starts and exits without any error.
This is the code I use (and works for me in iphone)
@
CCSpriteFrameCache::sharedSpriteFrameCache()->addSpriteFramesWithFile(“textura01.plist”);
@
I test this code and works on iphone too, but neither on android.
when i run this code in android, a msg popup telling —— Get data from file(assets/mainmenu.png) failed —— and it is go way…. application exit with out errors…
yes… i did… i put and i can see them in assets folder in my android project
menu.plist
menu.png
files… both are generated from texture packer and…
mainmenu.png
is a frame inside the menu.png…
Do you think should i put mainmenu.png also inside the resource folder? it is the original image file that i have used to make that texture packer sprite sheet “menu.png+menu.plist”
if i need to put all the original files in sprite sheet with the them inside the resource folder, why should i use a sprite sheet? i can just use them as separate PNG file and get them using “CCSprite::spriteWithFile” right?
but i had to use “CCSprite::spriteWithSpriteFrameName” instead, because of i need to use them as frames of a sprite sheet.
i know… i must be doing something wrong here… Because there should be ppls out there… who got this working… so it should be something wrong with my code… so pls help me to figure it out what i am doing wrong here…
never mind… sorry about all the fuzz… it is just that my menu.plist got wrong info for its texture packer “textureFileName” if anybody got the same problem as mine… try checking detail inside your .plist file… and… believe me it is gonna save you a whole lot of time of debugging