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 with its Y Origin set to Top:

ColoredRectangle with Top Y Origin

Center

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

ColoredRectangle with Center Y Origin

Bottom

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

ColoredRectangle with Bottom Y Origin

Baseline

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

Text with Baseline Y Origin

Baseline refers to the bottom of the text for letters without descenders. For more information see the Wikipedia Baseline page.

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).

50,000 xp aligned by baseline

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

Last updated

Was this helpful?