【问题标题】:Proper implementation of Particle Designer plist emitters in cocos2d?在 cocos2d 中正确实现粒子设计器 plist 发射器?
【发布时间】:2011-05-24 19:00:18
【问题描述】:

我对如何正确使用粒子设计器中制作的发射器和 cocos2d 中的 Retina 显示器感到困惑。我尝试使用具有非高清纹理的发射器(例如fire.png)保存为“particle.plist”,无论是否嵌入纹理,我都会收到某种警告。然后我用fire-hd.png 和名称“particle-hd.plist”制作了另一个发射器,我收到了相同类型的警告,比如cocos2d: Filename(fire-hd.png) contains -hd suffix. Removing it. See cocos2d issue #1040

搜索问题 #1040 会得到一些信息,但不足以让我解决这个问题。

一点启示?

【问题讨论】:

    标签: cocos2d-iphone particles


    【解决方案1】:

    您需要准备这些文件。

    • particle.plist(它使用纹理“fire.png”,有或没有嵌入纹理)
    • fire-hd.png

    CCParticleSystem首先搜索-hd纹理文件,然后是non-hd纹理文件,最后是嵌入的纹理数据。

    编辑

    Particle plist 的“Warning HD file not found”是错误警告。在这种情况下,您可以在没有任何警告的情况下使用 CCParticleSystem initWithDictionary 方法。

    NSString *path = [[NSBundle mainBundle]
        pathForResource:@"particle1_traile" ofType:@"plist"];
    NSDictionary *dict = [NSDictionary dictionaryWithContentsOfFile:path];
    CCParticleSystem *particle = [[[CCParticleSystemQuad alloc]
        initWithDictionary:dict] autorelease];
    

    【讨论】:

    • @ Kazuki - 我试过了,得到了警告:CCFileUtils: Warning HD file not found: particle1_trail-hd.plist 我的项目中有particle1_traile.plistfire.pngfire-hd.png
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多