GithubHelp home page GithubHelp logo

openfl / dragonbones Goto Github PK

View Code? Open in Web Editor NEW
37.0 37.0 14.0 1.07 MB

Runtime support for DragonBones skeletal animation

Home Page: http://www.dragonbones.com

License: Other

Haxe 100.00%
haxe openfl

dragonbones's Introduction

MIT License Haxelib Version Build Status Community Discord Server


Introduction

The OpenFL project is an open-source answer to the needs of game and application developers everywhere, looking for a fast, simple approach to delivering creative masterpieces without relying on a specific implementation, such as a browser plugin.

Using the innovative Haxe programming language, OpenFL supports wildly different platforms using one codebase. Transitioning from one target type to another is simple, and keeps the strengths of the target environment. OpenFL builds to native C++, Neko or Flash bytecode, or JavaScript, enabling maximum compatibility and runtime performance.

OpenFL depends on Lime, which has easy-to-use command-line tools, and provides backend support.

Platforms

Currently, OpenFL supports the following platforms:

  • iOS
  • Android
  • HTML5
  • Windows
  • macOS
  • Linux
  • Flash
  • AIR

There is also a community effort to bring OpenFL to consoles, OpenFL is running on:

  • Switch
  • Wii U
  • PlayStation 4
  • PlayStation 3
  • PlayStation Vita
  • Xbox One

Additional details on console support will be available in the future.

OpenFL is also being used in additional environments:

  • TiVo boxes
  • Raspberry Pi
  • Node.js

Libraries

OpenFL is compatible with many libraries, ported from ActionScript or written originally in Haxe, including:

OpenFL also powers other platforms, such as Stencyl.

Code Editors

Plugins have been written for many code editors, but the most popular editors used for Haxe and OpenFL development are:

Easy Deployment

OpenFL includes the tools you need to build, package, install and run on each target platform.

For example, openfl test html5 will generate an HTML5 project, create a local web server and open your default browser.

Some platforms will require a standard SDK to build (such as Visual Studio C++ or Xcode). OpenFL includes "setup" commands to even help the install of these standard tools.

3D Support

OpenFL is designed primarily for 2D development, but you can use the OpenGLRenderer API to write your own WebGL-style code, and mix it with the OpenFL display architecture.

OpenFL also has support for the Stage3D API. If you like you can use this directly, or you can also use libraries such as Away3D or Starling.

Native Extensions

When you target a native platform, the output is true native C++, enabling deep integration with platform features and third-party SDKs. There is a standard Haxe "CFFI" API for connecting Haxe classes directly to C++ libraries.

We have also developed a straight-forward Android library project API for adding Java-based extensions, too. Native extensions can also use the standard Lime project format, for flexible control over dependencies, adding additional assets or tuning the output of your project.

The result are native extensions that can be made to interchangeably drop into projects, without breaking one another. We have made no attempt to emulate the system for AIR native extensions, which are much more difficult to create and less flexible.

Core Components

OpenFL relies upon Lime, a foundation for cross-platform project development.

hxcpp is used automatically by the Lime tools to manage the C++ compilation process for each platform, and to provide the Haxe standard library for C++ support.

License

OpenFL is free, open-source software under the MIT license.

Installing OpenFL

Follow the directions at openfl.org.

Development Builds

When there are changes, OpenFL is built nightly. Builds are available for download here.

To install a development build, use the "haxelib local" command:

haxelib local openfl-haxelib.zip

Building from Source

Clone the OpenFL repository:

git clone https://github.com/openfl/openfl

Tell haxelib where your development copy of OpenFL is installed:

haxelib dev openfl openfl

To return to release builds:

haxelib dev openfl

You may also need a development build of Lime installed.

dragonbones's People

Contributors

haoyu234 avatar jgranick avatar lmodlinski avatar matsefr avatar troyedwardsjr avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

dragonbones's Issues

Color transition problem

Hello.

I had a problem with color animation on Flash and Android targets for Starling renderer - alpha just didn't change. But on HTML5 it works properly.
I've discovered a mistake here:

_parseColorTransform(Reflect.field(rawData, DataParser.COLOR) || Reflect.field(rawData, DataParser.COLOR_TRANSFORM), frame.color);

https://github.com/openfl/dragonbones/blob/master/dragonBones/parsers/ObjectDataParser.hx#L1042

OR operator returns Bool as a result for flash and android and value as a result only for js. So we always get default color after parsing data and don't have animations for any color transformations.

Could you fix it in repo?

Thanks.

FrameEvent sometimes not dispatched issue/fix ?

Hi,
My game uses dragonbones a lot, and relies on FrameEvents for many things. I had to slightly modify this line :

prevTime <= crossedFrame.position

just replacing <= with <

Otherwise in some cases the frameEvent would never be dispatched, especially at low framerate. With this change it works 100% even at 1fps
I'm not sure it's a "real" issue because when we started our game dragonbones didn't have the tool they have now, so all our dragonbones come from flash. Maybe it's different when you export from their tool.

Still in my case it's definetely a real issue and just doing that small change fixes it entirely

Batching

DragonBones could benefit having batching using Tilemap when no mesh is used, and a custom rendering for meshes.

For now, every part of the animation is rendered in a separated Shape.

Mesh Support

It seems that mesh isn't supported with OpenFL.
I'm pretty sure it works with Starling, but is there a way to use it with just OpenFL (no Starling/Flixel)?

Thanks in advance,

Flixel code does not work with sample projects other than Dragon

To reproduce:

  • Open 'Ubbie-Mesh' or 'Sheep' projects in DragonBones
  • Export them to the samples/HelloDragonBones/Assets/ folder and call the project 'dragonboy_flixel'
  • cd samples/HelloDragonBones
  • lime test html5 (with Flixel installed)

In the case of Ubbie-Mesh, the program renders nothing and immediately crashes, with stack trace:

TypeError: Cannot read property 'texture' of null
    at dragonBones_flixel_FlixelSlot._updateFrame (HelloDragonBones.js:19685)
    at dragonBones_flixel_FlixelSlot._updateDisplay (HelloDragonBones.js:7697)
    at dragonBones_flixel_FlixelSlot._update (HelloDragonBones.js:7788)
    at dragonBones_Armature.advanceTime (HelloDragonBones.js:5822)
    at dragonBones_flixel_FlixelFactory.buildArmatureFlixel (HelloDragonBones.js:19455)
    at dragonBones_flixel_FlixelFactory.buildArmatureDisplay (HelloDragonBones.js:19431)
    at FlixelRender.create (HelloDragonBones.js:4314)
    [...]

In the case of Sheep, the program runs, but the render output is very malformed:

image

The OpenFL and Starling renderers behave correctly on both files. I tried exporting the sample Dragon project myself as well, and it works correctly.

I'm on flixel 4.7.0 / openfl 8.9.5

playing animation on COMPLETE event, START never gets dispatched issue/fix

Hi,
Not sure if that's intended or not, but if you listen for COMPLETE event on an armature and immediately play another animation on that armature, the START event never gets dispatched.

This is because the animation sends the event to the Armature, which is still processing events and clears the events list afterwards so any added event gets lost (did not check for a memory leak in that case but fore sure the event never gets pooled)

_events.length = 0;

simply commenting out that line and putting something like

for (i in 0...l)
{
     _events.shift();
}

solves the problem

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.