图片不会显示 [英] Images won't show up

查看:90
本文介绍了图片不会显示的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

使用cocos2d,我将图像放在桌面上并将其拖到项目中的资源文件中。它以前曾起作用,但现在不再起作用。有解决问题的技巧吗?



错误:


012-08- 10 15:30:55.884再次[9753:1be03] cocos2d:无法在CCTextureCache中添加image:soundoff.png



解决方案

观察到该行为的两个可能原因:


  1. 文件名包含小写/大写字母混合;这是很典型的,因为iOS区分大小写,而MacOS不区分大小写;因此,它可能会在模拟器中运行,但在设备上失败;或者,如果通过更改大写/小写来重命名文件(例如,将soundOff更改为soundoff),则MacOS上的构建系统不会将重命名的文件视为与原始文件不同,并且不会将其包含在构建中;


  2. 文件尚未真正添加到目标的复制阶段(检查目标的构建阶段)。


希望有帮助。


Using cocos2d I put images on desktop and drag them to resource file in my project. It worked before but not any more. Any tips to solve this?

The error:

012-08-10 15:30:55.884 again[9753:1be03] cocos2d: Couldn't add image:soundoff.png in CCTextureCache

解决方案

Two possible reasons why you could observer that behavior:

  1. the filename contains mixed lowercase/uppercase; this is typical, since iOS is case sensitive, while MacOS is not; so, it may happen that it works in the simulator, but fails on the device; or, if you rename a file by changing uppercase/lowercas (e.g., soundOff to soundoff), the build system on MacOS will not consider the renamed file as different from the original one and will not include it in the build;

  2. the file has not been actually added to the "copy phase" for your target (check the target's build phases).

Hope it helps.

这篇关于图片不会显示的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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