# misc/indicator (vanilla.js 0.4.0)

> https://vanillapunch.com/docs/vanilla.js/0.4.0/api/misc/indicator/

인디케이터 클래스.

## Indicator extends Object

인디케이터 클래스.

예제: 씬 위에 도는 톱니 그리기

```js
import { Engine, EngineConfiguration, Scene, Indicator, Vector2 } from "./build/vanilla.js";

const indicator = new Indicator();
indicator.setPosition(640, 360);
indicator.setRadius(32);
indicator.setColor("#ffd34dff");
indicator.setSpeed(Math.PI);

class IndicatorScene extends Scene {
	tick(timeDelta) {
		super.tick(timeDelta);
		indicator.tick(timeDelta);
	}

	draw(graphic) {
		super.draw(graphic);
		indicator.draw(graphic);
	}
}

const engineConfiguration = new EngineConfiguration();
engineConfiguration.referenceResolutionSize = Vector2.create(1280, 720);
const engine = new Engine(engineConfiguration);
engine.run(new IndicatorScene());
```

- `constructor()` (constructor, since 0.0.9): 생성.
- `tick(timeDelta)` (method, since 0.0.9): 갱신.
  - `timeDelta` number: 지난 프레임부터의 시간. (초, 숨겨져 있으면 돌지 않는다)
- `draw(graphic)` (method, since 0.0.9): 출력.
  - `graphic` Graphic: 그릴 그래픽. (숨겨져 있으면 그리지 않는다)
- `buildTeethSegments()` (method, since 0.4.0): 톱니 선분 목록 반환. (회전 전 중심 기준, [시작, 끝] 의 목록)
  - returns Vector2[][]: 톱니 8 개의 [시작, 끝] 선분 목록.
- `setPosition(x, y)` (method, since 0.0.9): 위치 설정.
  - `x` number: 중심 x 좌표.
  - `y` number: 중심 y 좌표.
- `getPosition()` (method, since 0.0.9): 위치 반환.
  - returns Vector2: 중심 위치. (복사본이 아니다)
- `setRadius(radius)` (method, since 0.0.9): 크기 설정.
  - `radius` number: 톱니 끝까지의 반지름. (1 보다 작으면 1)
- `getRadius()` (method, since 0.4.0): 크기 반환.
  - returns number: 톱니 끝까지의 반지름.
- `setColor(color)` (method, since 0.0.9): 색 설정.
  - `color` string | Color: (예: "#ff0000", "rgba(255,255,255,0.8)")
- `setSpeed(speedRadiansPerSecond)` (method, since 0.0.9): 회전 속도 설정.
  - `speedRadiansPerSecond` number: 회전 속도. (라디안/초, 음수면 반대로 돈다)
- `getRotation()` (method, since 0.4.0): 지금 회전 각도 반환. (라디안)
  - returns number: 지금 회전 각도. (라디안)
- `setVisible(isVisible)` (method, since 0.0.9): 출력 여부 설정.
  - `isVisible` boolean: 보이면 참. (거짓이면 tick 과 draw 가 아무것도 하지 않는다)
- `getVisible()` (method, since 0.0.9): 출력 여부 반환.
  - returns boolean: 보이면 참.
