flixel-ui
flixel-ui copied to clipboard
Substates/popups don't show if custom cameras are used
I have code like this in my play state:
haxe FlxCamera.defaultCameras = [FlxG.camera];
I have it there because I later add a camera to have a big scrollable FlxTilemap that doesn't render any ui elements on it.
When you have a popup/subscreen created through flixel-ui, though, it appears not to work, because it ends up behind the added camera.
As a workaround you can set .visible=false
for all cameras that aren't in .defaultCameras
in the substate's create()
, then put them back just before close()
.
Maybe flixel-ui should take care of that automatically? Or should this be left to library user implementation? (I'm not sure what's considered a workaround and what should "just work" out of the box in this case.)