Added a flixel factory backend and #if (openfl > 3.6.1) compiler conditionals.
Compiler conditionals are not fully complete but should still work on OpenFL 6 as they're just Arrays instead of Vectors. If anyone wants to help with that, you can commit to this pull request. But I thought I'd get feedback from Joshua Granick about how we should proceed from here to so I made this PR now.
However, it should be fully functional on OpenFL 3.6.1 and OpenFL 6.
Basic flixel demo/test under samples/HelloDragonbones. The JSON files were exported using the latest DragonBones (5.3).
Make sure to build using the webgl haxe define IE haxelib run lime build html5 -Dwebgl in order to be able to render anti-aliasing and any animations that require meshes.
Some notes:
I know you wanted to keep it as close as possible to the original AS3 API, but I had to change the animation field to animations because it conflicts with the animation field on FlxSprite and FlxStrip. Other suggestions are welcome.
On BaseObject I had to create a ClassMap class under the /util folder in order to give it similar functionality to an OpenFL 6 Dictionary to accept Class types.
The OpenFL event dispatcher can't really be used with specific FlxSprites because I believe it would require DisplayObjects being added to the stage, which is both tricky because you can't override a FlxGroup.add from a FlxSprite in order to also add a parallel DisplayObject to the flash display list (which HaxeFlixel doesn't use) at the same time and could result in pretty poor performance to add a DisplayObject for every FlxSprite which must then also be eventually be removed from the display list along with the FlxSprite. So I just used a global FlxG.stage for OpenFL events instead, for those that want to use them.
Feel free to add to this PR. Once it's merged into the main repo I can make a pull request add a demo to the flixel-demos repo and possibly make it a dependency of flixel-addons similar to spinehaxe, rather than put my fork on haxelib.
Added a flixel factory backend and
#if (openfl > 3.6.1)
compiler conditionals.Compiler conditionals are not fully complete but should still work on OpenFL 6 as they're just
Array
s instead ofVector
s. If anyone wants to help with that, you can commit to this pull request. But I thought I'd get feedback from Joshua Granick about how we should proceed from here to so I made this PR now.However, it should be fully functional on OpenFL 3.6.1 and OpenFL 6.
DragonBoy Gif.
Basic flixel demo/test under
samples/HelloDragonbones
. The JSON files were exported using the latest DragonBones (5.3).Make sure to build using the webgl haxe define IE
haxelib run lime build html5 -Dwebgl
in order to be able to render anti-aliasing and any animations that require meshes.Some notes:
I know you wanted to keep it as close as possible to the original AS3 API, but I had to change the
animation
field toanimations
because it conflicts with theanimation
field onFlxSprite
andFlxStrip
. Other suggestions are welcome.On
BaseObject
I had to create aClassMap
class under the/util
folder in order to give it similar functionality to an OpenFL 6Dictionary
to acceptClass
types.The OpenFL event dispatcher can't really be used with specific
FlxSprite
s because I believe it would requireDisplayObject
s being added to the stage, which is both tricky because you can't override aFlxGroup.add
from aFlxSprite
in order to also add a parallelDisplayObject
to the flash display list (which HaxeFlixel doesn't use) at the same time and could result in pretty poor performance to add aDisplayObject
for everyFlxSprite
which must then also be eventually be removed from the display list along with theFlxSprite
. So I just used a globalFlxG.stage
for OpenFL events instead, for those that want to use them.Feel free to add to this PR. Once it's merged into the main repo I can make a pull request add a demo to the
flixel-demos
repo and possibly make it a dependency offlixel-addons
similar to spinehaxe, rather than put my fork on haxelib.