Welcome To Cocos2D-XNA

web_banner

Cocos2D-XNA is a 2D/3D game developer’s framework that is written specifically for XNA. XNA is the game API developed by Microsoft for independently published games on Xbox Live Arcade. To support other platforms than the now deprecated Microsoft XNA targets, Cocos2D-XNA supports the MonoGame runtime.

This project is open source, freely available, and free of royalties or encumberance. The software is released under the GNU Affero General 29 Public License.

The source code is hosted at github: https://github.com/Cocos2DXNA/cocos2d-xna

13 Comments

  1. tin921 July 7, 2014 7:39 pm 

    hi, this is a really good framework. i like it a lot, i used it in a few apps/games with xamarin. how do i find information on parity of cocos2dxna with cocos2d? i see it’s on 3.1 now. and the new SpriteBuilder also produces a later version of ccb(i?) file too i think? does latest cocos2dxna supports them? thanks!!

    • totallyeviljake December 19, 2014 1:40 pm 

      The framework is currently at cocos2d-x version 2.3. We will be releasing a version that is on parity with cocos2d-x v3.3 in 2015.

  2. rcooper383 August 17, 2015 8:51 am 

    I’m having some issues with performance. I’ve noticed that when running on my Galaxy S3 the framerate will drop in half for a few frames then jump back up. I thought that it was something I was doing to I took everything out of the scene and its doing the same thing. Any ideas on what I should do?

    • totallyeviljake August 17, 2015 9:14 am 

      Intermittent performance errors is usually the work of the garbage collector. Maybe you have a huge memory buffer that is being collected, or lots and lots of temporary object instantiations that are finally being culled. Maybe you are doing some network operation that is downloading some image and that’s interfering with the UI thread performance. It’s hard to say what is the problem without more information about what is actually going on when the framerate drops.

      • rcooper383 August 19, 2015 8:20 pm 

        I have one spite that has a CCActionMoveBy that moves that sprite to the bottom of the screen then to the top. The action starts over when it gets to the top. I even took out the sprite and have an empty screen but the frame rate still drops. I even tried cocos sharp and it also has the same problem along with some other annoying issues. If I use the visual studio emulator or an iOS device it works fine. Any ideas?

        • totallyeviljake August 20, 2015 8:35 am 

          This sounds like a vendor GC issue. There is likely some garbage being created during the draw loops, either in MonoGame or in the Cocos2D-XNA framework. Android always has crappy GC performance. Some of the devices can do async GC and some only have one core and use cooperative multitasking to manage garbage collection. iOS doesn’t have this architecture so you won’t see similar problems there.

          Did you try it on some other Android devices? Are you using our version of MonoGame or the official MonoGame?

          • rcooper383 August 20, 2015 8:48 am 

            I will try it on some other devices. I am using the official monogame because i plan on using this on PS4.

        • totallyeviljake August 20, 2015 9:02 am 

          Try using our version on your android device just as a secondary data point. We have some bug fixes that the official MonoGame has not adopted.

        • totallyeviljake August 20, 2015 8:37 am 

          We don’t support CocosSharp. If you are getting fuzzy or pixelated sprites using Cocos2D-XNA then I am surprised. Typically that happens when the FOV calculation produces a scale that creates artifacts on your screen. Change your target resolution, or make sure you set the target resolution to the correct resolution that reflects that used when creating your sprites. The display of sprites is highly sensitive to their target resolution.

          • rcooper383 August 20, 2015 8:53 am 

            I was using cocossharp because I already have a xamarin license but I moved to this because of the direction they are taking it. I put it on my android device and the sprite still doesn’t look as crisp as it does on iOS. If I use monogame I can get it to look the way I want by setting the blend mode and sampler state on the sprite batch but doing that in cocos doesn’t have the same effect. Do I need to be using the version of monogame included in the source?

        • totallyeviljake August 20, 2015 8:55 am 

          Furthermore, MonoGame doesn’t take a target resolution. It just displays your image at source resolution. It’s up to you to set the scale. If you are expecting scale of 1 then that’s the problem You likely created sprites targeting your television screen display (PS4 target), which is crazy low compared to the mobile devices. So when you run it on a device that has 4X the resolution you get crazy pixilation. Always start with the highest possible target resolution for all of your artwork. The PS4 resolution is going to be the LOWEST resolution target. Don’t start there.

          • rcooper383 August 20, 2015 9:17 am 

            I am doing this the same as I did for cocos2d-x. I have all my sprites in folders for their scale and set the content directory on load finished. I also set the design resolution. It does work this way with cocos2d-x and all my android devices. Unfortunately i hate c++.

Leave a comment