One thing to note is you also have to pass in a collision box similar to the Flixel Spine plugin. buildArmatureDisplay ( new FlixelArmatureCollider ( 250, 250, 27, 25, 13, 8 ), dragonBonesData. You can do so by declaring a variable and then assigning the new FlxGroup to it which you will generate using the factory. Then you have to create a FlxGroup which will contain all the DragonBones Flixel Sprites. getBitmapData ( "assets/dragonboy_flixel_tex.png" ) ) Build Armature getText ( "assets/dragonboy_flixel_tex.json" )), Assets. getText ( "assets/dragonboy_flixel_ske.json" )) ) _factory. var dragonBonesData : DragonBonesData = _factory. Then you have to use the factory to parse the animation files that you’ve exported in order to read their data. Then, inside the create function under your FlxState class you have to create a FlixelFactory which generates flixel objects for DragonBones like so: var _factory = new FlixelFactory () Parse Data FlixelEvent import dragonBones.animation. FlixelArmatureCollider import dragonBones.flixel. FlixelArmatureDisplay import dragonBones.flixel. FlixelTextureAtlasData import dragonBones.flixel. DragonBonesData import dragonBones.flixel. Then save it to the assets folder in your Flixel project.įirst, import the packages we'll be using. Once you’re done, go to File > Export and export the animation using Data Version: 5.0 and Image Type: Texture Atlas. For the sake of this tutorial, we’re going to use a premade project that comes with DragonBones called DragonBoy that you can select from the starting menu. Then create a new animation using DragonBones. You can also download the sample project instead to follow along. Then create a new Flixel project template with Flixel Tools, and add DragonBones to your Project.xml. Installįirst install the library from haxelib using: haxelib install dragonbonesĪlthough it’s better to install directly from GitHub in order to always keep up with the latest updates: haxelib git dragonbones How exactly do you use DragonBones with Flixel? Well, that’s what I’ll be showing you, so let’s get started. Its DragonBones export should also work with the Flixel backend I’ve created. If you want a truly open source editor which can export to the DragonBones format while also being fully featured, check out the great alternative COA Tools for Blender. *One caveat is that DragonBones is not truly open source (if you care about that sort of thing), only the runtime is. Not only that, DragonBones is a fully featured, intuitive bone animation editor and has Mesh Deformation support just like Spine. Why would one use it over Spine? Well Spine can potentially be quite expensive for new indie devs, and DragonBones is free. Its a tool which allows you to animate static 2D images programmatically (similar to Flash tweening) without having to painstakingly animate each individual frame in a spritesheet. I’m here to write a post about DragonBones support for HaxeFlixel and how to use it.įirst of all, what is DragonBones? DragonBones is a free *open source alternative to the popular 2D bone animation tool Spine (which Flixel already has support for). When I tried your scene it failed to load and wrote in the log the following: .SerializationException: Error reading attachment: food, skin: defaultĪt .readSkeletonData(SkeletonJson.java:268)Īt .loadSkeleton(SkeletonViewer.java:195)Īt $UI$2.changed(SkeletonViewer.java:634)Īt .(ChangeListener.java:28)Īt .(Actor.java:182)Īt .(Actor.java:147)Īt .scene2d.ui.tChecked(Button.java:124)Īt .scene2d.ui.Button$1.clicked(Button.java:92)Īt .(ClickListener.java:89)Īt .(InputListener.java:59)Īt .(Stage.java:351)Īt .touchUp(InputMultiplexer.java:96)Īt .(LwjglInput.java:332)Īt .(LwjglApplication.java:217)Īt .lwjgl.LwjglApplication$1.run(LwjglApplication.java:126)Ĭaused by: : Named value not found: widthĪt .JsonValue.getFloat(JsonValue.java:657)Īt .readAttachment(SkeletonJson.java:332)Īt .readSkeletonData(SkeletonJson.java:265)Ĭaused by: there, I’m Troy ( creator and maintainer of the HaxeFlixel backend for DragonBones. Pointed out some great advice for Dragonbones users you should be able to verify your JSON output by running it through the official Spine skeletonViewer application as a first step in debugging.
0 Comments
Leave a Reply. |
Details
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |