Skip to content
CocosSharp is a C# implementation of the Cocos2D and Cocos3D APIs that runs on any platform where MonoGame runs.
C# Other
  1. C# 99.8%
  2. Other 0.2%
Branch: master
Clone or download
Latest commit 3af7475 Mar 2, 2017
Type Name Latest commit message Commit time
Failed to load latest commit information.
CocosSharp.Content.Pipeline.Importers Update Pipeline Importers project to 4.5 so it will compile against W… Oct 8, 2015
CocosSharp.Forms Update to version Jan 9, 2016
Extensions Forms: Tests.WP8.1: Link up to use CCGameView Sep 19, 2015
MonoGame @ 2953aff Update MonoGame forms_support branch Nov 28, 2015
PCL Update to version Jan 9, 2016
ProjectTemplates update template for xs6 Aug 5, 2016
ReleaseNotes Add v1.7.1.0 release notes Jan 9, 2016
TestWin8Phone Merge branch 'master' of into text… Aug 7, 2015
box2d [project.json] Fix VS2015 compile problems. The issue is that even wh… Oct 25, 2015
docs Update CCNode documentation Aug 20, 2014
src Update CCPhysicsBody.cs Nov 21, 2016
testWin81Store Add Windows8.1 XAML implementation as well as test solution tests/Coc… Oct 8, 2015
testWin8Store Merge branch 'master' of into text… Aug 7, 2015
tests Close #288 Audio engine: Add ability to check if effects are playing Dec 19, 2015
tools Updating release version script to incorporate forms targets Oct 10, 2015
.gitattributes initial commit Oct 26, 2012
.gitignore Add /CocosSharp.Forms/packages to .gitignore to make sure the package… Oct 28, 2015
.gitmodules Add submodule ChipmunkSharp Aug 9, 2014
CocosSharp.Android.sln Fix for Android Linking Jul 8, 2015
CocosSharp.MacOS.sln Make sure we only reference CS objects and wrap others for the PCL in… Aug 10, 2014
CocosSharp.Windows.sln Fix Build Script - Remove content build project from CocosSharp.Windo… Jan 16, 2015
CocosSharp.Windows8.sln Fix windows 8 build process. Aug 29, 2014
CocosSharp.Windows81.sln Add Windows8.1 XAML implementation as well as test solution tests/Coc… Oct 8, 2015
CocosSharp.WindowsDX.sln Include CCNodeGrid in Windows projects. Feb 25, 2015
CocosSharp.WindowsGL.sln Fix references for WindowsGL projects - Need to reference… Jan 22, 2015
CocosSharp.WindowsPhone.sln Make WP8 compile again due to regressions in the API Jul 30, 2014
CocosSharp.WindowsPhone81.sln Modify WindowsPhone81 to compile with Any CPU which matches MG project. Jul 31, 2015
CocosSharp.WindowsUWP.sln Rename Windows Universal projects to use UWP nomenclature which follo… Oct 15, 2015
CocosSharp.iOS.sln Project updates from Windows - iOS Unified API Jan 14, 2015
CocosSharp.sln Rename cocos2d.Content.Pipeline.Importers to CocosSharp.Content.Pipel… Nov 24, 2014
CocosSharpAPI.cs Add support to allow modifying of the LineHeight of the label SystemF… Mar 31, 2015 Update Jan 22, 2014
LicenseAndCredit.txt Update Jan 22, 2014 Add CocosSharp Windows 8.1 project definition. Aug 19, 2015 Update README to link to website Jul 17, 2016 Fix XS templates build. Still referencing CocosSharp.PCL.Shared.*.nupkg Nov 9, 2015


CocosSharp is an easy to use library for simple games using C# and F#. It is a .NET port of the popular Cocos2D engine, derived from the Cocos2D-X engine via Cocos2D-XNA.

This library is MIT licensed.



We have a dedicated website at In particular, check out the contribute section for how to be part of the CococsSharp community.


Xamarin is hosting forums for CocosSharp here:

Learn More

To learn more, see the


This project is open source, freely available, and free of royalties or encumberance. The software is released under the highly permissive MIT License.


When you first check out, run

git clone --recursive

so you will have all the submodules checked out for you.

With existing checkouts, run

git submodule update --init --recursive

to make sure you get the latest changes in the submodules. Repos that were checked out recursively will do this automatically, but it doesn't hurt to run this manually.

To pull external changes into a submodule

cd <submodule>   
git pull origin <branch>   
cd <top-level>; git add <submodule>   
git commit

To make changes in a submodule

cd <submodule>

  • By default, submodules are detached because they point to a specific commit. Use git-checkout to put yourself back on a branch.

git checkout <branch>

work as normal, the submodule is a normal repo

git commit/push new changes to the repo (submodule)
cd <top-level>; git add <submodule> # this will record the new commits to CocosSharp MonoGame submodule
git commit
  • To switch the repo of a submodule

    edit '.gitmodules' to point to the new location

git submodule sync -- <path of the submodule> # updates .git/config

  • I think this will checkout from the new location, internally. It may take a while for big repos.
git submodule update --recursive
git checkout <desired new hash> # This changes the pointer of the submodule

The desired output diff is a change in .gitmodule to reflect the change in the remote URL, and a change in / where you see the desired change in the commit hash

You now have everything you need to start start developing with CocosSharp

Getting Started

Solutions & Projects - MonoGame

After clone you will need to generate the MonoGame projects.

The solution and project files are generated by Protobuild when you double-click Protobuild.exe on Windows from or run mono Protobuild.exe under Mac OS or Linux.
Note: that the previous needs to be done in the MonoGame directory.

To modify the projects you must edit the .definition file in the Build/Projects/ folder and re-execute Protobuild.

For more information and advanced usage, please refer to the Protobuild wiki.

Test Bed

We have created solutions for all the supported platforms that serves as our TestBed for each platform.

You can find those in the tests directory



As the saying goes "A picture is worth a thousand words" well sample code can be just as effective.

So to get started we have placed a number of samples here: Samples


There is a special case for Xamarin iOS MonoTouch running on the simulator where they aggressively call garbage collection themselves. This should not affect the devices though. On the Simulator the GC label will always be 0 (zero)


This project is a fork of the Cocos2D-XNA project, which is a port of the C++-based Cocos2D-X API, which in turn is a cross-platform port of the cocos2d-iphone project.

The focus of this fork is to create a library that is idiomatically correct for C# and remove many of the historical warts inherited from the straight ports from C++ and Objective-C.

You can’t perform that action at this time.