> 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/polygon.md).

# Polygon

### Introduction

Polygons can be added to screens and entities to create complex collision. Polygons will automatically be used in an entity's collisions if the entity is marked as ICollidable in Glue. For information on working with the Polygon object in code, see the [Polygon class reference](https://github.com/flatredball/FlatRedBallDocs/tree/main/documentation/api/flatredball/math/geometry/polygon.md).

### Adding a Polygon to an Entity

Polygons can be added to entities:

1. Select the entity which will have the Polygon
2. Select the Quick Actions tab
3. Click the Add Object button

   ![](https://951240982-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-M_fye9Ufg3vzJxwX5Hk%2Fuploads%2Fgit-blob-cb292da1dcba23c29f44583b0bfb0e52de4c1ed8%2F2021-08-img_612e5ad3416db.png?alt=media)
4. Select the Polygon type
5. Click OK

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

If the containing Entity is an ICollidable, the Polygon will automatically be used when performing collision.

### Editing Polygons

Polygons can be edited through the Points tab, which appears when selecting a Polygon.

![](https://951240982-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-M_fye9Ufg3vzJxwX5Hk%2Fuploads%2Fgit-blob-9fc4133f860f6694a85eb79cedfba688f4e158fd%2F2017-01-img_58750dacc45f8.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/polygon.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.
