> 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/glue-reference/objects/object-types/glue-reference-layer/glue-reference-objects-is2d.md). Agents can also search and read this documentation through its [MCP server](https://docs.flatredball.com/flatredball/~gitbook/mcp).

# Is2D

### Introduction

The Is2D option can be used to make a Layer use 2D coordinates. Layers which are 2D can be used even if the current Camera is in 3D. Layers which are 2D are often used to create HUDs and UI Screens.

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

For information on how to use Layers in code, see [the Layer reference page](https://github.com/flatredball/FlatRedBallDocs/tree/main/documentation/tools/glue-reference/objects/glue-reference-layer.md).

### Common Usage

The most common usage of the Is2D property is to create a 2D layer in a game which uses a 3D camera. Typically 3D games will have some type of 2D hud, so a 2D layer is needed to hold hud.

### 2D Layer on a 3D camera

This example shows a simple setup where a 2D layer can be used on a 3D graphic. First, the game is set up to use a 3D camera.

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

Next, a Sprite is added to a GameScreen. It has the following variable values:

* Texture = GroundTexture

  ![](https://951240982-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-M_fye9Ufg3vzJxwX5Hk%2Fuploads%2Fgit-blob-e9d288cd4aeea5028a267c622eb4434bdb6f6536%2F2017-02-img_58a1d772cfa7e.png?alt=media)
* Right Texture Pixel = 512
* BottomTexturePixel = 512
* Texture Address Mode = Wrap
* Y = -10
* Rotation X = 1.5708

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

The GameScreen has a layer named **Layer2D** for 2D objects.

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

Finally the **GameScreen** has a Text instance called **GameOverText** which has been placed on **Layer2D.**

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

The result is **SpriteInstance** is drawn in 3D, but the **GameOverText** is drawn and positioned in 2D.

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


---

# 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/glue-reference/objects/object-types/glue-reference-layer/glue-reference-objects-is2d.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.
