title | description | published | date | tags | editor | dateCreated |
---|---|---|---|---|---|---|
Main Page |
Welcome to Chroma Framework! |
true |
2023-06-05 13:23:25 UTC |
markdown |
2021-09-03 13:00:31 UTC |
This documentation is still under construction. Things will be added, changed or completely removed without any warning! {.is-warning}
Ever thought to yourself the following as a C# developer?
Man, I wish I could just download a single library and start writing the game of my dreams without worrying about all the dependencies and stuff...
The wait is over! Chroma is a fast, intuitive and powerful 2D game development framework with focus on quick prototyping and simplicity without sacrificing functionality. Additionally, you can build and run your game on any supported platform using just a single codebase!
Chroma is licensed under the very permissive MIT license, which essentially means that you have a choice of extending the framework and sharing your changes with the public, or keeping these completely to yourself. Same goes for your game's code, of course!
Sounds too good to be true, huh?
GameCore.cs
using System.Numerics;
using Chroma;
using Chroma.Graphics;
namespace MyGame
{
public class GameCore : Game
{
public GameCore()
: base(new(false, false))
{
}
protected override void Draw(RenderContext context)
=> context.DrawString("Hello, world!", new Vector2(16, 16));
}
}
Program.cs
using System;
namespace MyGame
{
static class Program
{
static void Main(string[] args)
=> new GameCore.Run();
}
}
That's it. This is the minimum required to get something drawn on screen. Convinced yet?
Fine. Have the entire list of available examples.
Chroma is designed for the new .NET from the ground up. It does not try to act as a replacement for any pre-existing engines or frameworks and instead tries to take small, good parts of each and make them work together while adding some much needed convenience to aid with quick set-up and cut the boilerplate on the game developer's side of things. It is the answer to the author's frustration with the existing .NET game development libraries:
- MonoGame Too broad for the author's liking. Stays in the box of the "XNA way of doing things". Trivial tasks that should be available out-of-box need external libraries to get done.
- Love2DCS It's taking something designed for Lua into .NET. Essentially playing a catch-up game every time Love2D makes a change or adds a new feature.
- Ultraviolet Framework It almost scratched the author's itch, but it was not intuitive enough. There is a trade-off between simplicity and modularity. Ultraviolet takes the latter over the former.
While other libraries certainly have their own strengths and advantages - for example MonoGame and Ultraviolet support mobile platforms, 3D capabilities are a first-class feature, all of them also have their own thriving communities, there is one weakness connecting them all. They are a hassle to set up and maintain.
Right now Chroma supports Linux, Windows and macOS. 32-bit processors are not supported. Mobile platform support is hesitantly considered, but not being worked on yet. If you need these right now, then it may be better for you to look into one of the frameworks listed above.
All Chroma needs is a working .NET 6 (or newer) installation. Once you got that working you can get to the next section.
The library is available for download from the NuGet package gallery.
In order to add a package to an existing project, run:
dotnet add package Chroma --version 0.57.1
API reference is generated automatically and is available at https://chroma-2d.github.io.
Wow, paint me surprised! You are most welcome to publish a Github issue!
It would be great to have you on board! Fork Chroma, make your changes and - when you are done - submit a pull request. Then we can talk what can be done about it.
If you would like to contribute to this documentation effort, shoot me a message. I certainly could use some help writing and then maintaining all of this.