FlxCamera render only chosen objects



  • How can I make a Camera render only specified objects? I realise that I can give all other objects a separate camera but it'd be handy to say "don't render anything except these couple of objects", so that I don't have to mess about with their cameras. Is that at all possible?


  • administrators

    Try FlxCamera.defaultCameras = [FlxG.camera], to render sprites only to the main camera by default. Then you can pick a few objects you want to render on custom camera(s) and set object.cameras = [customCamera] for each of those.



  • Ah, thanks a lot, does exactly what I want! Not sure how I missed that :P


Log in to reply