Cocos2dx安卓:从文件中获取数据(资产/ *)失败 [英] Cocos2dx Android: Get data from file(assets/*) failed

查看:144
本文介绍了Cocos2dx安卓:从文件中获取数据(资产/ *)失败的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如果你需要在你的Cocos2dx Android项目(在Eclipse)添加您的图像?

Where do you need to add your images in your Cocos2dx Android project (in Eclipse)?

目前,他们是在资源文件夹像什么提到的的雷Wenderlich的博客,但我得到一个错误:得到(资产/ MyFileName的)数据失败为每个图像。我还添加了这些图像在Eclipse中资产的文件夹,并没有什么区别。

They're currently in the 'Resources' folder like what is mentioned on Ray Wenderlich's blog, but I get an error when I run it in the emulator: "get data from (assets/myFileName) failed" for each image. I also added these images to the assets folder in Eclipse, and it makes no difference.

它正常工作在iOS端。

It works fine on the iOS side.

有什么建议?

推荐答案

所以实际的问题是不是与建筑物或复制过程。

So the actual problem wasn't with the building or copying process.

我有一个类,我做了将应用正确的preFIX到CCSprite如果它是一个iPhone,iPad等我做了一些改变CCMenuItemImage源$ C ​​$ C将这一文件,但在iOS和Android Cocos2dx文件是分开的,所以Android项目并没有使用新的code,并没有添加正确的preFIX,所以这是没有找到图片。

I had a class I made that would apply the correct prefix to a CCSprite if it was an iphone, ipad, etc. And I made some changes to the CCMenuItemImage source code to incorporate this file, but the iOS and Android Cocos2dx files are separate, so the Android project wasn't using the new code, and wasn't adding the correct prefix, so it wasn't finding the image.

感谢大家对你的答案!

这篇关于Cocos2dx安卓:从文件中获取数据(资产/ *)失败的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆