CocosSharp is a C# implementation of the Cocos2D and Cocos3D APIs that runs on any platform where MonoGame runs.
Перейти к файлу
Kenneth Pouncey cf13620f5b Include CCNodeGrid in Windows projects. 2015-02-25 07:31:43 +01:00
CocosSharp.Content.Pipeline.Importers Add NuGet nuspec for Mac version of Custom Content Importers 2015-01-23 09:23:45 +01:00
Extensions Close #50 CCSprite: Add TexelToContentSizeRatio 2014-11-19 13:51:03 +11:00
MonoGame@6937b22369 Update MonoGame 2015-02-10 16:24:36 +01:00
PCL Regen PCL API and fix up CCLayerColor because of compile errors for the API when generated. 2015-02-03 20:12:18 +01:00
ProjectTemplates XS template: iOS.Empty proj: Fetch latest CS NuGet 2015-01-31 12:08:57 +11:00
ReleaseNotes v.1.3.1.0 release notes 2015-01-25 00:32:51 +11:00
TestWin8Phone Add test for loading TileMap from StreamReader issue https://github.com/mono/CocosSharp/issues/134 2015-02-14 08:20:22 +01:00
box2d Add CCGeometryBatch which can be used to create a batch Vector, Color, TextureCoords and Texture to be mapped. 2015-01-29 17:35:45 +01:00
docs Update CCNode documentation 2014-08-20 17:09:54 +02:00
src Include CCNodeGrid in Windows projects. 2015-02-25 07:31:43 +01:00
testWin8Store Add test for loading TileMap from StreamReader issue https://github.com/mono/CocosSharp/issues/134 2015-02-14 08:20:22 +01:00
tests Small clean up DrawPrimitivesTest so that base.OnEnter is not called multiple times. 2015-02-24 05:58:22 +01:00
tools Update UpdReleaseVer.sh script to include CocosSharpTemplates PCL references and manifest release notes reference 2015-01-26 08:01:34 +01:00
.gitattributes initial commit 2012-10-26 16:54:50 -07:00
.gitignore updated the nuspec to better describe each package. 2013-06-08 23:12:50 -07:00
.gitmodules Add submodule ChipmunkSharp 2014-08-09 12:11:51 +02:00
CocosSharp.Android.sln Fix #16 Latest MonoGame linking fails when deploying Android tests project to device 2014-09-21 21:19:18 +10:00
CocosSharp.MacOS.sln Make sure we only reference CS objects and wrap others for the PCL interface. 2014-08-10 18:17:54 +02:00
CocosSharp.Ouya.sln Fix regressions in CocosSharp Android and Ouya projects after update to MonoGame. 2014-05-26 18:05:30 +02:00
CocosSharp.Windows.sln Fix Build Script - Remove content build project from CocosSharp.Windows.sln 2015-01-16 06:57:35 +01:00
CocosSharp.Windows8.sln Fix windows 8 build process. 2014-08-29 17:02:55 +02:00
CocosSharp.WindowsDX.sln Include CCNodeGrid in Windows projects. 2015-02-25 07:31:43 +01:00
CocosSharp.WindowsGL.sln Fix references for WindowsGL projects - Need to reference Lidgren.xxx.WindowsGL project and not Lidgren.xxx.Windows. 2015-01-22 14:41:27 +01:00
CocosSharp.WindowsPhone.sln Make WP8 compile again due to regressions in the API 2014-07-30 12:16:12 +02:00
CocosSharp.iOS.sln Project updates from Windows - iOS Unified API 2015-01-14 08:56:58 +01:00
CocosSharp.sln Rename cocos2d.Content.Pipeline.Importers to CocosSharp.Content.Pipeline.Importers. 2014-11-24 07:30:58 +01:00
Contributing.md Update 2014-01-21 22:01:22 -05:00
LicenseAndCredit.txt Update 2014-01-21 22:01:22 -05:00
MonoGame.build Fix build for windows after MonoGame update 2014-10-01 09:25:32 +02:00
README.md Update README.md 2014-10-13 06:50:05 +02:00
default.build Add NuGet nuspec for Mac version of Custom Content Importers 2015-01-23 09:23:45 +01:00

README.md

CocosSharp

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.

Forums

Xamarin is hosting forums for CocosSharp here:

http://forums.xamarin.com/categories/cocossharp

Learn More

To learn more, see the https://github.com/mono/CocosSharp/wiki

License

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

Git

When you first check out, run

git clone --recursive git@github.com:xamarin/CocosSharp

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

CocosSharp.Tests.Android.sln	
CocosSharp.Tests.Windows.sln	
CocosSharp.Tests.Windows8.sln	
CocosSharp.Tests.WindowsDX.sln	
CocosSharp.Tests.WindowsGL.sln	
CocosSharp.Tests.WindowsPhone.sln	
CocosSharp.Tests.WindowsPhone7.sln	
CocosSharp.Tests.iOS.sln
CocosSharp.Tests.MacOS.sln	

Samples

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

Statistics

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

History

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.