As some of you might have read on our public slack, we have had two hack days this week where we had the opportunity to do some fun projects using Defold. I decided to do something I have been thinking about for a while, a tool created in Defold! So without a long introduction, let me introduce my hack result; DefAnimator 0.1
DefAnimator is a (super non-official ;)) visual animation tool built as a regular Defold project. The idea is that you can use it to author simple GO animations visually with keyframes, then save the animations as Lua-modules and use in your own game/project.
The output from the save functionality creates a Lua module that returns a function consisting of chained
local my_animation = require "my_animation" -- my_animation.lua was saved using the tool and is located in the project directory function init(self) my_animation("gameobject_id") -- starts the generated animation on GO /gameobject_id end
- GUI was done using dirtylarry, with some modifications and custom “theme”.
- Some OS native interaction using LuaJit FFI, including:
- Native “Save/Open File” dialogs using defold-dialogs
- Native context menus using a lib I’m planning to release soon-ish.
- Being able to use DefAnimator as a library in your own project. Meaning that you could in theory just depend on DefAnimator to animate your own GOs (create a
.collectionwith your own GO, add the supplied
defanimator.guiand it “Should just work ™”.
I want to release it as open source eventually, but for now here is a (a bit buggy ) OSX version.
DefAnimator.zip (2.3 MB)
Known bugs and limitations
- The timeline is a bit wonky, you can only select keyframes on the current property you have selected (visualised as lighter gray in the left most column).
- Playback preview does not loop.
- Playback preview does not handle different easing options, but the saved file will.
- Opening/Loading previously saved animations does not work currently.