Skip to content
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

Open
xerosugar opened this issue Feb 14, 2016 · 4 comments
Open

OpenFL (with HaxeFlixel) demo problem #85

xerosugar opened this issue Feb 14, 2016 · 4 comments

Comments

@xerosugar
Copy link

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!

@TiZ-HugLife
Copy link

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?

@xerosugar
Copy link
Author

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.

@TiZ-HugLife
Copy link

Maybe you could use a second scene with an orthographic camera, and sprite objects.

@ramsestom
Copy link

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

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:

var _babylonSprite:Sprite = new Sprite();
FlxG.addChildBelowMouse(_babylonSprite);

engine = new Engine(_babylonSprite, false); 
scene = new Scene(engine);

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)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants