Cocos2D-Mono
2.8.0
See the version list below for details.
dotnet add package Cocos2D-Mono --version 2.8.0
NuGet\Install-Package Cocos2D-Mono -Version 2.8.0
<PackageReference Include="Cocos2D-Mono" Version="2.8.0" />
<PackageVersion Include="Cocos2D-Mono" Version="2.8.0" />
<PackageReference Include="Cocos2D-Mono" />
paket add Cocos2D-Mono --version 2.8.0
#r "nuget: Cocos2D-Mono, 2.8.0"
#:package Cocos2D-Mono@2.8.0
#addin nuget:?package=Cocos2D-Mono&version=2.8.0
#tool nuget:?package=Cocos2D-Mono&version=2.8.0
<div align="center">

MonoGame powered built the cocos2d way!
<sub>Built from source only — not in the NuGet packages (see <a href="#platform-support">Platform support</a>):</sub><br>
</div>
Packages
Starting with the release after 2.5.10, Cocos2D-Mono ships as three consolidated, multi-targeted NuGet packages (DesktopGL for Windows/Linux/macOS, WindowsDX, Android, and iOS in one package each):
| Package | Use it when |
|---|---|
Cocos2D-Mono |
The engine, including the MonoGame content-pipeline (MGCB) build task dependency. |
Cocos2D-Mono.Core |
Same engine, without the MGCB dependency — for projects that don't use the content pipeline. |
Cocos2D-Mono.Box2D |
The Box2D physics port (also flows transitively through the packages above). |
Migrating from the per-platform packages (Cocos2D-Mono.DesktopGL,
Cocos2D-Mono.Windows, Cocos2D-Mono.Linux, Cocos2D-Mono.macOS,
Cocos2D-Mono.Android, Cocos2D-Mono.iOS and their .Core.* variants):
2.5.10 is the final release under those IDs — replace the reference with
Cocos2D-Mono (or Cocos2D-Mono.Core) and the right target framework is selected
automatically. The DesktopGL/Windows/Android/iOS flavors are compiled exactly as their
legacy counterparts were. If you are coming from the dedicated Linux/macOS
packages, note that the unified DesktopGL build uses the same compile-time flavor the
flagship Cocos2D-Mono.DesktopGL package always shipped on those platforms (this can
relocate CCUserDefault storage written by the old dedicated packages).
Platform support
| Tier | Platforms | How to get it |
|---|---|---|
| Packaged | Desktop via DesktopGL (Windows, macOS, Linux), WindowsDX, Android, iOS | The NuGet packages above. |
| Source only | Mac Catalyst, tvOS | Build the engine from source against our MonoGame fork, checked out beside this repository at the commit pinned by MONOGAME_FORK_REF in build.yml. MonoGame publishes no package for either platform, so neither is in the published NuGet packages. |
| Registered console developers | PlayStation 5 | On the 2.5.x line — see the roadmap. |
A published NuGet package only carries a platform when that platform's MonoGame dependency can also be restored from nuget.org — which is what separates the first two tiers. The build enforces it: dotnet pack leaves the source-only targets out even on a Mac with the fork present.
Building Mac Catalyst or tvOS from source
On macOS, with the .NET 10 SDK:
# 1. The workload for the platform you want
dotnet workload install maccatalyst # or: tvos
# 2. Our MonoGame fork, checked out beside this repository at the commit CI pins
# (MONOGAME_FORK_REF in .github/workflows/build.yml)
git clone https://github.com/Cocos2D-Mono/MonoGame.git ../MonoGame
git -C ../MonoGame checkout <MONOGAME_FORK_REF>
git -C ../MonoGame submodule update --init ThirdParty/StbImageSharp ThirdParty/StbImageWriteSharp
# 3. The fork's MonoGame.Framework for that platform
dotnet build ../MonoGame/MonoGame.Framework/MonoGame.Framework.MacCatalyst.csproj -c Release
# tvOS: MonoGame.Framework.tvOS.csproj
# 4. The engine for that platform (Box2D first, as CI does)
TFM=net10.0-maccatalyst26.0 # tvOS: net10.0-tvos26.0
dotnet build src/Box2D/Box2D.csproj -c Release -f $TFM -p:TargetFrameworks=$TFM
dotnet build src/Cocos2DMono/Cocos2DMono.csproj -c Release -f $TFM -p:TargetFrameworks=$TFM
A game can instead reference src/Cocos2DMono/Cocos2DMono.csproj from its own net10.0-maccatalyst or net10.0-tvos project: once step 3 has run, the engine finds the fork's assembly and adds the target on its own. Directory.Build.props documents the overrides for a fork checked out somewhere else.
Getting Started
Check out the guides!
Building & running the test app
The library and its interactive test app build from a single solution, Cocos2DMono.sln
(the per-platform solutions were retired when the build was consolidated).
# Build the library (all target frameworks)
dotnet build Cocos2DMono.sln
# Run the interactive test app on the desktop (DesktopGL / net10.0)
dotnet run --project Tests/Cocos2DMono.IntegrationTests/Cocos2DMono.IntegrationTests.csproj -f net10.0 -p:TargetFrameworks=net10.0
# Run the headless unit tests
dotnet test Tests/Cocos2DMono.UnitTests/Cocos2DMono.UnitTests.csproj
The test app's scenes live in Tests/cocos2d-mono.Tests/; the multi-targeted
Cocos2DMono.IntegrationTests project compiles them into a runnable host for each platform
(desktop, Windows, Android, iOS). See Tests/README.md for details.
Contributing
Thanks so much for your interest in cocos2d-mono and wanting to contribute to the project! Here's a guide to help you get started.
CONTRIBUTING.md covers the working conventions that apply across all Cocos2D-Mono repositories — branching and PR flow, how changes are verified, API stability, and how releases are cut.
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net10.0 is compatible. net10.0-android was computed. net10.0-android36.0 is compatible. net10.0-browser was computed. net10.0-ios was computed. net10.0-ios26.0 is compatible. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. net10.0-windows7.0 is compatible. |
-
net10.0
- Cocos2D-Mono.Box2D (>= 2.8.0)
- MonoGame.Content.Builder.Task (>= 3.8.5)
- MonoGame.Framework.DesktopGL (>= 3.8.5)
- SharpZipLib (>= 1.4.2)
- SkiaSharp (>= 3.116.1)
- SkiaSharp.NativeAssets.Linux (>= 3.116.1)
- SkiaSharp.NativeAssets.macOS (>= 3.116.1)
- System.Drawing.Common (>= 8.0.11)
-
net10.0-android36.0
- Cocos2D-Mono.Box2D (>= 2.8.0)
- MonoGame.Content.Builder.Task (>= 3.8.5)
- MonoGame.Framework.Android (>= 3.8.5)
- SharpZipLib (>= 1.4.2)
-
net10.0-ios26.0
- Cocos2D-Mono.Box2D (>= 2.8.0)
- MonoGame.Content.Builder.Task (>= 3.8.5)
- MonoGame.Framework.iOS (>= 3.8.5)
- SharpZipLib (>= 1.4.2)
-
net10.0-windows7.0
- BitMiracle.LibTiff.NET (>= 2.4.639)
- Cocos2D-Mono.Box2D (>= 2.8.0)
- MonoGame.Content.Builder.Task (>= 3.8.5)
- MonoGame.Framework.WindowsDX (>= 3.8.5)
- SharpZipLib (>= 1.4.2)
NuGet packages (1)
Showing the top 1 NuGet packages that depend on Cocos2D-Mono:
| Package | Downloads |
|---|---|
|
Cocos2D-Mono.Core
Cocos2D-Mono.Core is a metapackage variant of Cocos2D-Mono that excludes the MonoGame.Content.Builder.Task MSBuild target. Reference this package instead of Cocos2D-Mono if you do not use the MonoGame content pipeline. The runtime DLL (Cocos2DMono.dll) is identical - only the build-time content-pipeline flow differs. |
GitHub repositories
This package is not used by any popular GitHub repositories.
2.8.0 - More nullable reference type annotations (menus, misc nodes, tile maps and support helpers), plus fixes found while converting: some failures now throw ArgumentException, ArgumentNullException, InvalidOperationException or InvalidDataException instead of NullReferenceException, and a few fixes change behavior. Gzip data now decompresses with System.IO.Compression, which rejects a bad checksum. Apart from nullability, no public API changed. Read the CHANGELOG's Upgrading notes before updating.
2.7.0 - The first nullable reference type annotations (nodes, input, layers and scenes, actions, particles, sprites, textures and labels): projects with nullable enabled now see which members can be null. Apart from nullability, no public API changed. It also fixes bugs found while converting; some failures now throw ArgumentException or NotSupportedException instead of NullReferenceException, and a few fixes change behavior. Read the CHANGELOG's Upgrading notes before updating.
- See https://github.com/Cocos2D-Mono/cocos2d-mono for the full changelog.