Love2dCS is a C# wrapper for LÖVE, an awesome game framework. You can use it in your C#-based applications. (This document is still in the works.)
Love2dCS was designed to be as close as possible to the original LÖVE API, as such the documentation provided from LÖVE largely covers usage of Love2dCS.
widnows-x86/x64 | MacOS-x64 | ubuntu-16-x64 | ubuntu-18-x64 | ubuntu-19-x64 | |
---|---|---|---|---|---|
.net standard 1.0 | √ | √ | √ | √ | √ |
.NET Framework 4.5.1+ | √ | ||||
Mono 4.6+ | ? | ? | ? | ? | ? |
.dotnet core 2.0+ | √ | √ | √ | √ | ? |
module | description |
---|---|
Love.Audio | Provides an interface to output sound to the user's speakers. |
Love.Event | Manages events, like key presses. |
Love.Filesystem | Provides an interface to the user's filesystem. |
Love.Font | Allows you to work with fonts. |
Love.Graphics | Drawing of shapes and images, management of screen geometry. |
Love.Image | Provides an interface to decode encoded image data. |
Love.Joystick | Provides an interface to connected joysticks. |
Love.Keyboard | Provides an interface to the user's keyboard. |
Love.Mathf | Provides system-independent mathematical functions. |
Love.Mouse | Provides an interface to the user's mouse. |
Love.Sound | This module is responsible for decoding sound files. |
Love.Timer | Provides high-resolution timing functionality. |
Love.Touch | Provides an interface to touch-screen presses. |
Love.Video | This module is responsible for decoding and streaming video files. |
Love.Window | Provides an interface for the program's window. |
Love.Resource | save/load data utils |
Love.Misc.Moonshine | A post-processing effect repository for LÖVE. |
Love.Misc.FPSGraph | A small FPS graphing utility for LÖVE. |
It’s pretty easy to get started with LÖVE! Just check out these code snippets.
🆚 Drawing text
using Love;
class TestScene : Scene
{
public override void Draw()
{
Graphics.Print("Hello, World!", 400, 300);
}
static void Main(string[] args)
{
Boot.Init();
Boot.Run(new TestScene());
}
}
🖼 Drawing an image
using Love;
class TestScene : Scene
{
Image image = Graphics.NewImage("test.png");
public override void Draw()
{
Graphics.Draw(image, 300, 200);
}
static void Main(string[] args)
{
Boot.Init();
Boot.Run(new TestScene());
}
}
🎶 Playing a sound
using Love;
class TestScene : Scene
{
Source source = Audio.NewSource("test.mp3", SourceType.Stream);
public override void Load()
{
source.Play();
}
static void Main(string[] args)
{
Boot.Init();
Boot.Run(new TestScene());
}
}