df-loader

df-loader: Load and use sprites and animations generated by DarkFunction Editor easily.
https://github.com/rogersanctus/df-loader

To install, run:

haxelib install df-loader 1.2.3 

See using Haxelib in Haxelib documentation for more information.

README.md

DarkFunction Editor - Loader

Sprites and Animations loader for Haxe and OpenFL.

This library was developed to load and use sprites and animations generated by DarkFunction Editor easily. It depends on OpenFL library: openfl.

To install the dependencies:

haxelib install openfl

To configure OpenFL for Native/Flash/Html5:

openfl setup

Installing

Just download and extract this library into your project folder and use it. Or install it via haxelib:

Last changes on from this repository:

haxelib git df-loader https://github.com/rogersanctus/df-loader.git

Last release from lib.haxe.org:

haxelib install df-loader

A simple Spritesheet test:

var sprs: DfSpritesheet = new DfSpritesheet( Assets.getText("teste.sprites"), "path_to_images" );

var renderer = new DfRenderer( new DfContentDef(sprs) );

// Create sprites with the sprites names on the generated xml file
var spr1 = new DfSprite("/sprite/0");
var spr2 = new DfSprite("/sprite/1");

spr1.x = 64;
spr2.x = 128;

// Add sprites to the renderer
renderer.addChild(spr1);
renderer.addChild(spr2);

// Add the renderer view to the sprite
addChild( renderer.view );

// Render the renderer
renderer.render();

The teste.sprites file:

<?xml version="1.0"?>
<!-- Generated by darkFunction Editor (www.darkfunction.com) -->
<img name="teste.png" w="64" h="32">
  <definitions>
    <dir name="/">
      <dir name="sprite">
        <spr name="0" x="0" y="0" w="32" h="32"/>
        <spr name="1" x="32" y="0" w="32" h="32"/>
      </dir>
    </dir>
  </definitions>
</img>

More samples at examples directory.

Known issues

  • Rotations on animations will not work as expected when each cell (frame) have more than one sprite with position different from the animation center point.
Contributors
rogersanctus
Version
1.2.3
Published
12 years ago
Dependencies
License
MIT

All libraries are free

Every month, more than a thousand developers use Haxelib to find, share, and reuse code — and assemble it in powerful new ways. Enjoy Haxe; It is great!

Explore Haxe

Haxe Manual

Haxe Code Cookbook

Haxe API documentation

You can try Haxe in the browser! try.haxe.org

Join us on GitHub!

Haxe is being developed on GitHub. Feel free to contribute or report issues to our projects.

Haxe on GitHub

⌂