百科.dev
全部条目在线工具AI 编程趋势榜开源项目技术资讯提交条目
登录
< 返回工具列表
L

Love2dCS

> 编程语言
开源

C# 封装 LÖVE,一个 2D 游戏引擎

179 stars0 点赞1 次浏览
访问官网GitHub

工具介绍

C# 封装 LÖVE,一个 2D 游戏引擎

Love2dCS - C# Wrapper for LÖVE

discord channel here: https://discord.gg/nF9wMkK | gitee-国内访问速度较快


LoveSharp(Love2dCS) is a C#/F# Wrapper for LÖVE game engine, it can be used your C#/F# based Application.

  • Nuget Package - ~17MB: https://www.nuget.org/packages/LoveSharp
  • Nuget Package (old) - ~17MB: https://www.nuget.org/packages/Love2dCS (old)
  • Windows(x64/x86) Only Nuget Package (old)- ~6MB: https://www.nuget.org/packages/Love2dCS-win (old)
  • Ubuntu(x64) Only Nuget Package (old) - ~6MB: https://www.nuget.org/packages/Love2dCS-ubuntu (old)
  • MacOS(x64) Only Nuget Package (old) - ~6MB: https://www.nuget.org/packages/Love2dCS-mac (old)

Links

  • Document at https://endlesstravel.github.io | 中文文档(还没写完)

  • love wiki

  • ImGui Support: LoveSharp.Imgui, based on ImGui.NET , with nuget:

  • Aseprite Runtime Support : LoveSharp.MetaSprite

  • Spine Runtime Support : LoveSharp.Spine , with nuget:

  • Tiled Map Editor Runtime Support : LoveSharp.Tiled

  • Test file example / Physics Test example

  • Easy to install with Visual Studio/MonoDevelop (install introduce)

Support Platform

  • windows-x86 / windows-x64 / ubuntu-16 x64 / ubuntu-18 x64 / MacOS 10.12+ x64 with .net startard 1.2 (.NET Core | .NET Framework 4.5.1 | Mono 4.6)

Status

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. There is a difference between Love2dCS and LÖVE where is :

  • The Love.XXX.New* in C# can access to files anywhere. In the original functin can only access the contents of the current folder.
  • The love.timer.getTime in C# as The time in seconds since the start of the game beacuse of C# double to float precision
  • The love.math module in LÖVE is named Love.Mathf in Love2dCS
  • The love.system module in LÖVE is named Love.Special in Love2dCS
  • The love.thread module in LÖVE is not supply, you can use Threading.Thread in C# instead.
  • Most index begin from 1 at LÖVE. However, but index will begin from 0 at Love2dCS
  • Love2dCS provide more build-in module to convience use.
  • You can work with lua as well, but only love.load love.update and love.draw are native supported : Work with lua. The rest of callback function is not supported.
  • Love2dCS currently based on LÖVE 11.1

Examples

Drawing text

csharp
using Love;
class Program : Scene
{
    public override void Draw()
    {
        Graphics.Print("Hello World!", 400, 300);
    }

    static void Main(string[] args)
    {
        Boot.Run(new Program());
    }
}

Next to development

  • Improve the document : in development
  • Fully support Love 11.2 : in development

Finished:

  • [√] Support Ubuntu : now support ubuntu 16/18
  • [√] Add support for .net core
  • [√] Support call lua function : Love.Lua.Call(name, ...arg) / Love.Lua.LoadString / Love.Lua.LoadFile (here)
  • [√] Support helpper function : Keyboard.IsPressed / Keyboard.IsReleased / Joystick.IsPressed / Joystick.IsReleased / Joystick.IsGamepadPressed /Joystick.IsGamepadReleased
  • [√] Add support for Physics

Test

Module Process code comment Test ubuntu Test Remark
Audio 80% 80% 50% test
Data / / Need to binding
Event 50% /
FileSystem 80% 80% 90% test detail
Font 80% 90%
Graphics 80% 00%
Image 80% 90%
Joystick 80% 00% Need add code comment
Keyborad 95% 95% 95% test detail
Mathf (love.math) 80% 90%
Mouse 90% 90% 90% test Mouse.SetRelativeMode will crash, need to repair
Physics 80% / 20% test Need more test case
Sound 90% 90%
Special (love.system) 90% 90% 90% test
Thread / / Not supported / No need to support
Timer 95% 95%
Touch 80% 00%
Video 80% 80% 90% test
Window 80% 80%

develop log

change log

Distribute

  • (recommand) on .net 2.2 : use tool https://github.com/Hubert-Rybak/dotnet-warp to publish single executable.

  • (recommand) on .net 3.0+ : Self-contained can be used to publish single executable

  • ref: https://www.hanselman.com/blog/MakingATinyNETCore30EntirelySelfcontainedSingleExecutable.aspx

  • publish ref: https://executecommands.com/publishing-single-executable-exe-in-net-core-3-0/

  • msdn ref: https://docs.microsoft.com/en-us/dotnet/core/whats-new/dotnet-core-3-0#single-file-executables

  • msdn ref `` : https://docs.microsoft.com/en-us/dotnet/core/whats-new/dotnet-core-3-0#assembly-linking

  • designs file: https://github.com/dotnet/designs/blob/master/accepted/single-file/design.md

Development

Develop document

Contributor

  • thanks matej-zajacik for his contribute on add and improve document. Without him, the grammatical errors of documents would flourish everywhere.

Issues· 0 开放

查看全部 Issues在 GitHub 打开

暂无开放 Issues,或尚未同步最近议题。

> 标签

C#2d-game-enginecsharpgame-enginelove2d

暂无评论,来聊聊你的看法吧

> 工具信息

发布日期2026年8月1日
最后更新2026年9月18日
分类编程语言
定价开源

> 相关工具

T
TypeScript
JavaScript 的超集,为前端与全栈提供静态类型
P
Python
通用编程语言,广泛用于 Web、数据与 AI
G
Go
Google 推出的简洁高效系统语言