---
name: "CanvasContext.translate"
mode: "api"
versionRequirements:
  - { name: "Base Library", version: "2.21.8" }
title: "translate"
---

## CanvasContext.translate

> [VERSION] Base Library >= 2.21.8

### Description

Translate the origin (0, 0) of the current coordinate system

### Parameters

`Params`

| Parameter | Type | Required | Description |
| --- | --- | --- | --- |
| `x` | `number` | Yes | Horizontal translation |
| `y` | `number` | Yes | Vertical translation |

### Return Value

None


### Examples

#### Translate the coordinate system

```ts
const ctx = ty.createCanvasContext('myCanvas');
ctx.translate(50, 50);
ctx.fillRect(0, 0, 100, 50);
ctx.draw();
```
