Rigby2D: a free, open-source 2D skeletal animation editor, now with a native Defold runtime

Hi everyone! First post here :waving_hand:

I’m Jaisurya, and I make Rigby2D, a free and open-source 2D skeletal animation editor (MIT or Apache-2.0). Today’s release adds a full runtime for Defold.

What it is

The runtime is a native extension: the Rigby2D runtime written in C++, which your build server compiles for Windows, macOS, Linux, Android, iOS and HTML5. It plays everything the editor makes:

  • meshes and weights, IK, transform / path / physics / slider constraints
  • skins, clipping, two-color tint, blend modes, events
  • layered tracks with crossfades and queued animations
  • whole scenes: a stage with several characters, a camera and parallax

It matches the editor frame by frame: CI replays the reference runtime’s output against the C++ one on every commit (bone matrices, vertices, colors, draw order, events).

Install

Add this to game.project ▸ Dependencies and fetch libraries:

https://github.com/jaisurya-dev-art/rigby2d/releases/latest/download/rigby2d-defold.zip

Then, on a game object with a factory for /rigby2d/piece.go:

local rigby2d = require("rigby2d.rigby2d")

function init(self)
    self.hero = rigby2d.new({ skeleton = "/assets/hero.skel", atlas = "/assets/hero.atlas", animation = "idle" })
    self.hero:on_event(function(e) print(e.name) end)
end

function update(self, dt)
    self.hero:update(dt)
end

Scenes work the same way with rigby2d.new_scene({ scene = "/assets/intro/intro.scene.json" }).

Performance

The C++ code writes each frame’s triangles straight into the mesh components’ vertex buffers: no per-vertex work in Lua and no allocation in steady playback. NILA, our demo character (39 bones, 890 mesh vertices, hair physics), poses in about 12 µs.

Sprite sheets too

If you’d rather play frames, the editor can export a sprite sheet straight to a Defold atlas with one animation per animation.

Links

It’s brand new, so feedback, bug reports and “this broke in my project” are all very welcome. Thanks for making such a nice engine to build for!

5 Likes

The Dependency URL will be published with 0.5 Update, coming this Friday November 6.

Until then you can copy the runtimes/defold/rigby2d folder from GitHub. If you try it, I’d love to hear how it goes :folded_hands:

2 Likes