# 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/blob/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

   ![](/files/k3YTxfFDTWksxVgOqpT7)
4. Select the Polygon type
5. Click OK

   ![](/files/vpxPTnfKV1Gvpmv4C5My)

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.

![](/files/iGKLvlVvYEhMpVXYOHNn)


---

# Agent Instructions: Querying This Documentation

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

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.flatredball.com/flatredball/glue-reference/objects/object-types/polygon.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
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.
