Git Product home page Git Product logo

df-loader's Introduction

##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.

df-loader's People

Contributors

rogersanctus avatar

Stargazers

Ludovic Bas avatar Andy Lu avatar  avatar Dennis Adriansyah Ganda avatar  avatar

Watchers

James Cloos avatar  avatar  avatar

df-loader's Issues

openfl error compile error

Hi,

I just installed df-loader, I have used df-loader in one of my previous game. Now have just installed on new laptop.

After installing I was having Uint error and I fixed it using jgranik solution of copying std/uint.hx to src.

While compiling for any platform, I am having following error:

Please I need urgent fix/solution to this.

bin/flash/haxe/DefaultAssetLibrary.hx:594: lines 594-622 : Field getMusic is declared 'override' but doesn't override any field
bin/flash/haxe/DefaultAssetLibrary.hx:664: lines 664-711 : Field getText is declared 'override' but doesn't override any field
bin/flash/haxe/DefaultAssetLibrary.hx:731: lines 731-747 : Field list is declared 'override' but doesn't override any field
bin/flash/haxe/DefaultAssetLibrary.hx:907: lines 907-933 : Field loadMusic is declared 'override' but doesn't override any field
bin/flash/haxe/DefaultAssetLibrary.hx:965: lines 965-1005 : Field loadText is declared 'override' but doesn't override any field
Build halted with errors (haxelib.exe).

I commented the overrided function but these files getting overwritten by compiler. And I have checked that without df-loader in xml project runs but enabling it fails

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.