Camera

Introduction

Objects in Screens and Entities can be of type Camera. A Camera object will (by default) represent the main Camera (FlatRedBall.Camera.Main).

If an object in an Entity is a Camera, then this will (by default) attach the main Camera to the Entity.

If an object in a Screen is a Camera, then this object serves as an alias for FlatRedBall.Camera.Main, but no attachment occurs.

IsNewCamera

The IsNewCamera property is a property which only appears on objects which are of type Camera.

  • If this property is false (the default value) then the Camera object is assigned to the main Camera (FlatRedBall.Camera.Main).
  • If theis property is true, Glue will create a new Camera instance. This is not often used but can be used for split-screen games.

Example Usage

If you are developing a game which requires logic for initializing or controlling the Camera then you may want to organize this code into an Entity. The Camera object facilitates setting this up in Glue. The process is as follows:

  1. Create an Entity which will contain all of the logic. For example an Entity named CameraEntity
  2. Right-click on the CameraEntity’s objects and add a new object
  3. Select Camera as the type

Now you can code logic in the CustomInitialize and CustomActivity of your CameraEntity.