Cocos2DMono.Samples
2.5.3
dotnet new install Cocos2DMono.Samples::2.5.3
Cocos2D-Mono Project Templates
A collection of project templates for quickly getting started with Cocos2D-Mono game development. These templates provide ready-to-use project structures for multiple platforms including Windows, Android, iOS, macOS, Linux, and DesktopGL.
Overview
Cocos2D-Mono is a 2D game framework built on top of MonoGame that provides additional features and functionality for 2D game development. These templates make it easy to get started with new Cocos2D-Mono projects on your platform of choice.
Features
- Project templates for multiple platforms:
- Android
- Windows
- iOS
- macOS
- Linux
- DesktopGL (cross-platform OpenGL)
- Core variants of each template that include precompiled content
- Ready-to-use application structure with common game components
- Consistent structure across all platforms for easier cross-platform development
Getting Started
Option 1: Install via .NET CLI
The templates are available as a NuGet package that can be installed with the .NET CLI:
dotnet new install Cocos2DMono.Samples
Once installed, you can create a new project using one of the following commands:
# Create a Windows project
dotnet new c2mwindows -n MyGame
# Create an Android project
dotnet new c2mandroid -n MyGame
# Create a DesktopGL project
dotnet new c2mdesktopgl -n MyGame
# Create an iOS project
dotnet new c2mios -n MyGame
# Create a Linux project
dotnet new c2mlinux -n MyGame
# Create a macOS project
dotnet new c2mmacos -n MyGame
For the core variants (with precompiled content):
# Use the core variants by adding 'core' to the template name
dotnet new c2mcorewindows -n MyGame
dotnet new c2mcoreandroid -n MyGame
# etc.
Option 2: Install via Visual Studio Extension
For Visual Studio users, we also provide a Visual Studio extension for easier project creation:
- Open Visual Studio
- Go to Extensions > Manage Extensions
- Search for "Cocos2D-Mono Project Templates"
- Click Download and install
- Restart Visual Studio
After installation, you can create a new project by:
- File > New > Project
- Search for "Cocos2D-Mono" in the project template search box
- Select the desired platform template
- Name your project and click Create
Template Types
Standard Templates
These templates include content files (.spritefont files, images, etc.) that need to be compiled during the build process:
c2mwindows
- Windows project using DirectXc2mandroid
- Android projectc2mios
- iOS projectc2mdesktopgl
- Cross-platform desktop project using OpenGLc2mlinux
- Linux projectc2mmacos
- macOS project
Core Templates
These templates include precompiled content (.xnb files) for faster build times and are ready to run immediately:
c2mcorewindows
- Windows core projectc2mcoreandroid
- Android core projectc2mcoreios
- iOS core projectc2mcoredesktopgl
- Cross-platform desktop core project using OpenGLc2mcorelinux
- Linux core projectc2mcoremacos
- macOS core project
Building From Source
If you want to build the templates from source:
git clone https://github.com/brandmooffin/cocos2d-mono
cd cocos2d-mono-project-templates
dotnet pack ./Cocos2DMono.Samples/Cocos2DMono.Samples.csproj -o "./Nuget Packages"
License
These templates are released under the MIT License. See the LICENSE file for details.
Links
Contributing
Contributions are welcome! Please feel free to submit a Pull Request.
-
net8.0
- No dependencies.
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
- Removed Ouya specific code
- Fix .NET 8 target path for Android