> For the complete documentation index, see [llms.txt](https://docs.flatredball.com/gum/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/gum/gum-tool/gum-elements/general-properties/rotation.md).

# Rotation

## Introduction

`Rotation` can be used to rotate Gum components. Rotation is measured in degrees, where positive values rotate an object counterclockwise about its origin ([X Origin](/gum/gum-tool/gum-elements/general-properties/x-origin.md) and [Y Origin](/gum/gum-tool/gum-elements/general-properties/y-origin.md)).

## Example

An object is rotated about its origin, which by default is its top-left corner:

![Rotating an object using the Rotation variable](/files/oBjRFzW7yDzC6dtwZZMq)

Objects can also be rotated visually by grabbing the rotation handle:

![Rotation handles can rotate an object](/files/qkU0IjWe5EpI2npRosgm)

Holding the SHIFT key snaps angles to 15 degree increments.

<figure><img src="/files/n3EwojSQGLCU5oFEMoOl" alt=""><figcaption><p>SHIFT rotate snaps to 15 degree increments</p></figcaption></figure>

## X Origin and Y Origin

The [X Origin](/gum/gum-tool/gum-elements/general-properties/x-origin.md) and [Y Origin](/gum/gum-tool/gum-elements/general-properties/y-origin.md) properties define the point of rotation for an object. The following animation shows how changing origin values can affect rotation.

![Objects rotate about their origin.](/files/zLceJ9jpz3CrGC2lYuSj)

{% hint style="info" %}
Rotation does not rotate the clip region of a container that clips its children, so rotating a container with [Clips Children](/gum/gum-tool/gum-elements/general-properties/clips-children.md) set to `true` will look broken. To rotate a container *and* keep its contents clipped, see [Rotating and Scaling Clipped Contents](/gum/gum-tool/tutorials-and-examples/examples/rotating-and-scaling-clipped-contents.md).
{% endhint %}


---

# 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 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/gum/gum-tool/gum-elements/general-properties/rotation.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.
