A LÖVE2D Compatibility Layer for Godot – An Idea for Discussion

I’ve been thinking for a while about creating a LÖVE2D compatibility layer on top of Lua GDExtension for Godot.

The main goal would be to make it possible to run existing LÖVE2D games inside Godot with minimal modifications to their original Lua code. Ideally, this could eventually make hundreds, if not thousands, of existing open-source LÖVE games much easier to port to Godot.

The idea wouldn’t be to implement every single API from LÖVE or expose every Godot feature from the beginning. Instead, it could start with a relatively small set of commonly used functions, enough to make basic games compatible, and gradually expand from there.

For example:

LÖVE2D API Possible Godot equivalent
love.graphics.newImage Texture2D loading
love.graphics.draw Sprite2D / custom drawing
love.graphics.rectangle draw_rect()
love.graphics.circle draw_circle()
love.graphics.print draw_string()
love.graphics.newCanvas SubViewport
love.graphics.setColor Modulate / drawing color
love.audio.newSource AudioStreamPlayer
love.keyboard.isDown Godot Input
love.mouse.getPosition Mouse position
love.timer.getDelta Frame delta

A compatibility layer could expose these functions under the familiar love.* namespace, translating calls into their corresponding Godot operations.

Of course, there are more complicated aspects to consider, such as shaders, canvases, transformations, blending modes, SpriteBatch, audio playback behaviour and filesystem compatibility. These could be implemented progressively as the project evolves.

As far as I know, nobody has attempted a comprehensive LÖVE2D compatibility layer for Godot 4 using Lua GDExtension.

I think this could be an interesting community project with significant potential. It would offer several advantages:

  • Reuse existing games: Make it easier to bring existing LÖVE2D projects into Godot without rewriting everything from scratch.

  • Godot’s export system: Potentially benefit from Godot’s export capab

just to clarify I did not started and I don’t even know If would manage to get it done, I just want to know if there would be any interest on that and if anyone has tried something like that before.