# base/pivot (vanilla.js 0.4.0)

> https://vanillapunch.com/docs/vanilla.js/0.4.0/api/base/pivot/

Pivot. (In the 2D coordinate system, uses top-left (0,0) ~ bottom-right (1,1) as the reference.)

Example: Set a node's pivot to the bottom center

```js
import { WorldNode, Pivot, Vector2 } from "./build/vanilla.js";

const iconNode = new WorldNode();
const iconSize = Vector2.create(64, 64);
iconNode.setContentSize(iconSize);
iconNode.setPivot(Pivot.bottomCenter);
const pivot = iconNode.getPivot();
console.log(pivot.x, pivot.y);
```

## Pivot (enum)

Pivot. (In the 2D coordinate system, uses top-left (0,0) ~ bottom-right (1,1) as the reference.)

- `topLeft` = `Vector2.create(0, 0)`: Top left. (0, 0)
- `topCenter` = `Vector2.create(0.5, 0)`: Top center. (0.5, 0)
- `topRight` = `Vector2.create(1, 0)`: Top right. (1, 0)
- `middleLeft` = `Vector2.create(0, 0.5)`: Middle left. (0, 0.5)
- `middleCenter` = `Vector2.create(0.5, 0.5)`: Middle center. (0.5, 0.5)
- `middleRight` = `Vector2.create(1, 0.5)`: Middle right. (1, 0.5)
- `bottomLeft` = `Vector2.create(0, 1)`: Bottom left. (0, 1)
- `bottomCenter` = `Vector2.create(0.5, 1)`: Bottom center. (0.5, 1)
- `bottomRight` = `Vector2.create(1, 1)`: Bottom right. (1, 1)
