Extending Camera and PassiveRendering

Nov 19, 2010 at 4:10 PM

I extended the OrthographicCamera by adding a simple Zoom property to it, and it works fine as long as PassiveRendering is False.  If I set PassiveRendering to True, changing my Zoom property value doesn't do anything unless I also do something else to the Game (move the camera's position, add objects, etc.)   I'm guessing that I need to trigger a PassiveRender message or something of that nature, but I'm unsure of how to do this.

Thanks,

Tige

Coordinator
Nov 19, 2010 at 8:37 PM

The easiest way is to make the Zoom property a Property<> - similar to DependencyProperty, in fact it wraps it.  If you take a look at the Camera class you'll see how its defining it for the Position and Target properties. When the value is changed it will fire off an event into the rendering part of Balder and make sure it renders in passive mode as well.