> 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/gum-runtime-api/renderinglibrary/camera.md).

# camera

### Introduction

The RenderingLibrary.Camera object provides control over the viewable area when rendering Gum objects (and any other non-Gum object added directly to the rendering library). In many cases FlatRedBall games do not interact with this object. If the RenderingLibrary.Camera is not modified, then the top-left corner is (0,0) and all objects render at 1:1 scale. Strictly speaking, the Camera object belongs to the RenderingLibrary, which is a basic rendering engine used by Gum. However, most FlatRedBall games use the RenderingLibrary to render Gum, so in many cases it can be thought of as the "Gum camera". The RenderingLibrary.Camera enables simple modifications to how Gum objects are rendered, such as adjusting zoom and offset values.

### Accessing the Camera

By default, games that use Gum rely on the **Default** set of RenderingLibrary objects. Therefore, the following code can be used to access the camera:

```lang:c#
var gumCamera = RenderingLibrary.SystemManagers.Default.Renderer.Camera;
```

### Moving the Camera

The Camera can be moved by changing its X and Y values. Moving the Camera will adjust the position of all on-screen Gum objects. The following code can be used to move the Camera up and down with up and down arrow keys:

```lang:c#
void CustomActivity(bool firstTimeCalled)
{
    var keyboard = InputManager.Keyboard;

    var gumCamera = RenderingLibrary.SystemManagers.Default.Renderer.Camera;

    if(keyboard.KeyPushed(Keys.Up))
    {
        gumCamera.Y-=5;
    }
    if (keyboard.KeyPushed(Keys.Down))
    {
        gumCamera.Y+=5;
    }
}
```


---

# 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/gum-runtime-api/renderinglibrary/camera.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.
