I'm trying to build a top down level using tilemap then render it on an additional camera trying to get the effect that it's a masked area in the center of my screen with the ui sitting around it. I then want to be able to zoom in/out on the tilemap with it still only taking up the same space on my screen. This sounds straightforward so my inability to get it working correctly shows that I'm clearly not understanding FlxTilemap/FlxCamera correctly particularly FlxCamera and also how flixel is rendering the game. I'm hoping someone can give me some pointers.
My first attempt was to create the tilemap, assign it to a new camera which is 600x600 (my screen is larger) then zoom in using the camera's zoom to change the scale of the tilemap, I found that when I increased the zoom that camera filled the whole screen. I couldn't work out how to change the order of the cameras to put the UI below it but I assume that's possible? I tried re-setting the width/height of the new camera after changing the zoom but it didn't seem to have any effect.
I then tried to simply change the scale of the tilemap and not change the camera except for scrolling it but I found that in this case when I zoomed out I was getting holes in the tilemap when I scrolled like it wasn't rendering correctly. I assume this is to do with the camera having trouble rendering a tilemap with a size that's not what it thinks it should be?
I can get round this problem by simply putting the level at the bottom the slapping the ui on top of it but I'd love to find a better way and to get a better handle on how flixel works.
I couldn't find any really good explanations for flxcamera, even going to to the old flixel site - all the tutorials things I've found simply take up the whole area and just move around a level following something. Is there a way to get the masked effect I was looking for - so the display size stays the same even when the zoom changes? You can set what camera a sprite renders on, but can you set which sprites a camera renders without setting the camera of every element added to your state?
I hope this all makes sense and I don't sound like too much of a noob.