> For the complete documentation index, see [llms.txt](https://docs.flatredball.com/flatredball/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.flatredball.com/flatredball/api/flatredball/graphics/layercamerasettings.md).

# LayerCameraSettings

### Introduction

The LayerCameraSettings class is a class which can be used to override the settings of a [FlatRedBall.Camera](https://github.com/flatredball/FlatRedBallDocs/tree/main/frb/docs/index.php) on a by [FlatRedBall.Graphics.Layer](https://github.com/flatredball/FlatRedBallDocs/tree/main/frb/docs/index.php) basis. LayerCameraSettings can be used to achieve the following:

* Adding a 2D layer when the main Camera is 3D
* Adding a 3D layer when the main Camera is 2D
* Adjusting the field of view on a 3D layer when the Camera is 3D
* Adjusting the orthogonal width and height values on a 2D layer when the Camera is 2D

### Code Example

The following code creates a [FlatRedBall.Graphics.Layer](https://github.com/flatredball/FlatRedBallDocs/tree/main/frb/docs/index.php) which renders in 2D even though the camera is rendering in 3D: Add the following using statement:

```
using FlatRedBall.Graphics;
```

Add the following to Initialize after initializing FlatRedBall:

```
// Make sure the camera is in 3D:
SpriteManager.Camera.Orthogonal = false;
// Create a new Layer
Layer layer = SpriteManager.AddLayer();
// Create a LayerCameraSettings
LayerCameraSettings layerCameraSettings = new LayerCameraSettings();
layerCameraSettings.Orthogonal = true;
layerCameraSettings.OrthogonalWidth = 800;
layerCameraSettings.OrthogonalHeight = 600;
layer.LayerCameraSettings = layerCameraSettings;
// Now the Layer will draw in 2D.  Let's make a Sprite:
Sprite sprite = SpriteManager.AddSprite("redball.bmp");
// Set TextureScale to 1 to "make it 2D"
sprite.PixelSize = 1;
SpriteManager.AddToLayer(sprite, layer);
```

![2DLayerCameraSettings.png](https://951240982-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-M_fye9Ufg3vzJxwX5Hk%2Fuploads%2Fgit-blob-c75f7719c9429ef137992e166f3aff91c0179acc%2Fmigrated_media-2DLayerCameraSettings.png?alt=media)

### LayerCameraSettings and Glue Layers

If a Layer is added through Glue, the generated code for the layer will instantiate a new LayerCameraSettings and add it to the Layer. By default these settings will match the camera at the time of Layer creation.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.flatredball.com/flatredball/api/flatredball/graphics/layercamerasettings.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
