# Y Origin

## Introduction

The **Y Origin** variable controls the point which an object is positioned by. By default the **Y Origin** is **Top**. The **Y Origin** is shown visually as a white "X" in the editor.

## Top

The following image shows a [ColoredRectangle](https://docs.flatredball.com/gum/gum-tool/gum-elements/coloredrectangle) with its **Y Origin** set to **Top**:

![ColoredRectangle with Top Y Origin](https://2695663588-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-M_fzQmxQ1VeUFHcoo2c%2Fuploads%2Fgit-blob-5c85a8f87b565d93835b477e6de48e80e669e540%2F25_19%2038%2016.png?alt=media)

## Center

The following image shows a ColoredRectangle with its **Y Origin** set to **Center**:

![ColoredRectangle with Center Y Origin](https://2695663588-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-M_fzQmxQ1VeUFHcoo2c%2Fuploads%2Fgit-blob-7f22f0e61d1aaa54340f7d8bb056877978169adb%2F25_19%2039%2018.png?alt=media)

## Bottom

The following image shows a ColoredRectangle with its **Y Origin** set to **Bottom**:

![ColoredRectangle with Bottom Y Origin](https://2695663588-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-M_fzQmxQ1VeUFHcoo2c%2Fuploads%2Fgit-blob-44a8e75b622ae4cb82a5326a98032b2e93cfac0c%2F25_19%2039%2056.png?alt=media)

## Baseline

The following shows a Text with its Y Origin set to Baseline:

<figure><img src="https://2695663588-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-M_fzQmxQ1VeUFHcoo2c%2Fuploads%2Fgit-blob-27ca3454de1c68695690fc6b1b0961003202a5e9%2F25_19%2042%2032.png?alt=media" alt=""><figcaption><p>Text with Baseline Y Origin</p></figcaption></figure>

Baseline refers to the bottom of the text for letters without descenders. For more information see the [Wikipedia Baseline page](https://en.wikipedia.org/wiki/Baseline_\(typography\)).

Baseline is often used to align fonts of different sizes. The following image shows two Text instances with different font sizes. Both are positioned by their baseline so their bottoms align properly (ignoring descenders, such as on the letter p and the comma).

<figure><img src="https://2695663588-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-M_fzQmxQ1VeUFHcoo2c%2Fuploads%2Fgit-blob-7e5711c92a3d072710c70b6d6fb080911bbbd10f%2Fimage%20(2)%20(1)%20(1)%20(1)%20(1)%20(1)%20(1)%20(1)%20(1)%20(1)%20(1)%20(1)%20(1)%20(1)%20(1)%20(1)%20(1)%20(1)%20(1)%20(1)%20(1)%20(1)%20(1)%20(1)%20(1)%20(1)%20(1).png?alt=media" alt=""><figcaption><p>50,000 xp aligned by baseline</p></figcaption></figure>

By contrast, the following image shows the same Text instances using bottom alignment.

<figure><img src="https://2695663588-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-M_fzQmxQ1VeUFHcoo2c%2Fuploads%2Fgit-blob-8b7b99c7ac1684c608fc50e96dc2b4aaabf5c7bb%2Fimage.png?alt=media" alt=""><figcaption></figcaption></figure>


---

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