-
Notifications
You must be signed in to change notification settings - Fork 43
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
OpenFL (with HaxeFlixel) demo problem #85
Comments
Are you trying to use Flixel and BabylonHx simultaneously, for 2d and 3d graphics at the same time? I'm not sure how well that can be supported. What is the use case? |
I just wanted to mix 2d and 3d elements in some way, either for cut scenes or for special effects. my idea was to simply overlay one of them over the other, and set the bgcolor of the top one to transparent. but I've given up on that thought now because it's just too much of a hassle, hehe :p just gonna use pre-rendered 3d images instead. takes up more memory... but less gray hairs. |
Maybe you could use a second scene with an orthographic camera, and sprite objects. |
I did it a few months ago (with haxeflixel git version too) and it was working. (I do not retested it recently though as I now use pure openfl (too many bugs in haxeflixel for my liking and I am wasting less time with pure openfl even if I have to recreate some haxeflixel feature with my own code..)) Basically what I did was just:
and I set a transparent background to the FlxState (state.bgcolor=0x01FFFFFF;) so that 2D FlxSprites from haxeflixel renders on top of the babylonHx scene... (note that the new haxeflixel version do not accept pure transparent background (at least at the time I tested it) so I had to use a background with an alpha value of 1 (0x01FFFFFF) rather than 0 (0x00FFFFFF) to have it work (in practice that do not change anything cause the human eye would still see it as transparent) |
I can run the OpenFL demo, but he haxeflixel graphics doesn't show up on screen.
Btw, I had to update the flixel code a little bit since I'm using the git version, but I can trace messages from the update method without a problem. The update-method needs to be updated to the following, if you're using a newer ver. of flixel, fyi:
update(elapsed:Float) {
super.update(elapsed);
}
Other stuff I got errors from where about 'random', which you can find in Flx.random, and some non-existing FlxColors, but just change them to something else to make it work.
Oh yeah, the HaxeFlixel debug overlay and mouse cursor still works as usual... so it's a bit odd that that works, but the rest of the demo doesn't (or is invisible).
Also -- if you turn the camera too far, the 3d objects disappear all of a sudden.
If you need to change the key to open the overlay, you can do it like this:
FlxG.debugger.toggleKeys = [FlxKey.TAB];
Thanks for a great library otherwise!
The text was updated successfully, but these errors were encountered: