# x\_position and y\_position

In OSL you can also read the position of the draw cursor as x and y co-ordinates. They are normalised to the center of the current frame/window based on the current context that the draw cursor is acting in.

```javascript
set_x 0
change_x 10
log x_position
// 10
```

This allows you to save the position of the cursor to return to later, for example:

```javascript
// go somewhere random
goto random(-100, 100) random(-100, 100)
// save the random position
x = x_position
y = y_position

// go somewhere random
goto random(-100, 100) random(-100, 100)
// return to the original position
goto x y
```

These variables are accessible in every context and cannot be overwritten with other data.

| x\_position | returns the current position of the draw cursor on the x axis |
| ----------- | ------------------------------------------------------------- |
| y\_position | returns the current position of the draw cursor on the y axis |


---

# 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://osl.mistium.com/commands/rendering/draw-cursor/x_position-and-y_position.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.
