A trap of adding resources into cocos2dx-wp8 project

By lihex Posted 2012-11-06 09:04 Comments 18

If you download the previous version of, you will find some test cases that has marked as pass but can not run properly on wp8 devices.
We sincerely regret this error, as it was caused by our sloppiness

I’ll explain why it is not running correctly on devices in debug mode.

In the project of the cocos2dx-wp8, game resources are placed in the Assets directory, this directory is also the root directory of the game resources:

If you want to create a sprite from a picture:

    CCSprite :: spriteWithFile ("Image / sprite.png");

It will read as:

    "App / Install / PATH / Assets / Image / sprite.png "

Not only we need to copy the game resources to the Assets directory, but also add each resource file to the VS project.
So how do we do it specifically?

For example to add sprite.png:

  1. Select Assets filter
  2. Right click > Add New Filter, named it Image # Select Image filter # Right click> Add Existing Item…
  3. Choose the \$YOUR_PROJECT/Assets/Image/sprite.png

This seems to work, but there are still problems:

The problem is, if we add a “sprite.plist” file, according to the above procedures, it is added to the project, but when you run the program, you will found that the program could not find “sprite.plist”!
Why is that? This problem has also plagued me for long time, fortunately, this has been resolved The reason is that only the file formats that Visual Studio can identify will be automatically packed into the app package, such as images: png, jpg. If you right-click to view the properties of these files, you will find the “Content field” is set as “Yes” and “Item Type” is set to properly type, such as “Image” in case of sprite.png
However VS does not recognize “plist”, so its Content is set to “No” and it’s “Item type” is set to “Does not participate in build”, which means plist files will not be packed into the application package.

The solution is very simple, that is to set the resource file Content field to “ Yes” , the Item type field to “Does not participate in build”.

The reason why it works in the Emulator but not on the physical devices is because Device Debugging configuration forgot to add those attributes to files.

The was updated, Please download again with the same url.
Download Zipball:


  • jonsd3

    Nice posts,…I feel really happy to have seen your webpage and look forward to so many more entertaining times reading here
    porno izle

    2014-01-15 07:07
  • jonsd3

    Pretty good post. I just stumbled upon your blog and wanted to say that I have really enjoyed reading your blog posts. Any way I’ll be subscribing to your feed and I hope you post again soon.
    sex game

    2014-01-15 09:25
  • Muneer_ahmed

    Established and family owned since 1983 and with over a quarter of century experience in sunless tanning products, Sun Laboratories, Inc. is the first professional self-tanning product manufacturer and distributor. Sothys

    2014-09-26 11:43
  • Muneer_ahmed

    Your article is very interesting, make persistent efforts, I believe there will be more and more people are concerned about your article! claw foot tub

    2014-10-16 17:52
  • Muneer_ahmed

    I have read your excellent post. This is a great job. I have enjoyed reading your post first time. I want to say thanks for this post. Thank you... logistika

    2014-10-19 10:57
  • sukh

    Contamos com o melhor pessoal com os melhores equipamentos do mercado para acabar de vez com o entupimento na sua casa."desentupidora zona oeste":

    2014-10-20 11:20
  • deborahphilip007

    You done certain good points there. I did a search on the subject and found nearly all persons will agree with your blog. <a href="" rel="follow">The Best VPN Service</a>

    2014-12-03 08:31
  • deborahphilip007

    I really enjoy simply reading all of your weblogs. Simply wanted to inform you that you have people like me who appreciate your work. Definitely a great post. Hats off to you! The Best VPN Service

    2014-12-03 08:35
  • Muneer_ahmed

    I thought it was going to be some boring old post, but it really compensated for my time. I will post a link to this page on my blog. I am sure my visitors will locate that extremely useful.

    2015-01-09 14:15
  • saleemkhan

    I will return to peruse some more. Pleasant post.thank you for taking the time to distribute this data exceptionally valuable! l

    bubblegum casting

    2015-01-12 20:05
  • andrewdavid

    Great read. I was anticipating this kind of article from you and you've delivered that. You've not disappointed me. I am really glad! See your WhatsApp contacts activity and read their messages!

    2015-01-22 16:10
  • andrewdavid

    Wonderful stuff once again. It's a real honor to read posts on your blog. You are so good of a writer. I just wish you will continue this flawless work of yours! Get Boom Beach Hack - Diamonds Generator software

    2015-01-26 14:43

Copyright © 2010 - 2015 Support Email: