Figured this out on my own. Each object needs to be given a reference to an Array
containing references to the FlxCamera
objects you want it shown on, and this needs to happen (usually) when the object is first made. The first time a FlxObject
calls update()
, if its cameras
is null, it assigns FlxG.cameras
as a default, which means all of the active cameras will display the object.
I did this by making a few static Array
's in my Main class, one for each camera group, and then in the constructor for my various classes, I would set their cameras
variable to point to the corresponding Array
.
The biggest frustration: Currently FlxGroup
does not pass its cameras
on to its members. Hopefully this will be added into future versions of Flixel so that FlxGroup
's can be assigned a camera group and have all their children also automatically assigned the same camera group.