---
title: moveTo
slug: viewer-2d/methods/moveTo
docTags: 
createdAt: 2024-02-21T14:33:53.989Z
---

Centers the viewbox on the specified coordinates.

## Example

::codepen{url="https://codepen.io/Catenda/embed/rNEpeVg"}

## Usage

```javascript
const x = 0;
const y = 0;

viewer2d.moveTo(x, y);
```

## Parameters

### x

X coordinate to center the viewbox on.

| **Type** | **Required** |
| -------- | ------------ |
| Number   | Yes          |

### y

Y coordinate to center the viewbox on.

| **Type** | **Required** |
| -------- | ------------ |
| Number   | Yes          |

