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
Screenshot
Video
http://forum.defold.com:/uploads/default/original/2X/2/21e09c9b794c40191a4dc8c2f6e13639d436c16e.mov
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 go.animation
calls.
Example usage
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
Implementation details
- 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.
Future plans
- 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
.collection
with your own GO, add the supplieddefanimator.gui
and it āShould just work ā¢ā.
Download
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.