I am trying to implement 2 cameras. One for the ga...
# flixel
e
I am trying to implement 2 cameras. One for the game elements and one for the UI elements:
Copy code
haxe
gCamera = new FlxCamera(0, 0, FlxG.width, FlxG.height);
uiCamera = new FlxCamera(0, 0, FlxG.width, FlxG.height);
gCamera.bgColor = FlxColor.BLACK;
uiCamera.bgColor = FlxColor.TRANSPARENT;
FlxG.cameras.add(gCamera);
FlxG.cameras.add(uiCamera);

// later in code pseudocode:
everyGameElementObj.camera = gCamera;
everyUIElementObj.camera = uiCamera;

// I also tried this, without success:
everyGameElementObj.cameras = [gCamera];
everyUIElementObj.cameras = [uiCamera];
The problem is that the
uiCamera
hides the game elements, showing -apart from the ui elements- a black screen. How can I make visible both
gCamera
and
uiCamera
on screen?