stadium / Exports / SensorLine
Class: SensorLine
다른 스프라이트의 접근 혹은 통과를 감지할 수 있는 스프라이트입니다.
const point1 = { left: 40, top: 50 }
const point2 = { left: 320, top: 120 }
const points = { p1: point1, p2: point2 }
const line = new SensorLine(points);Hierarchy
↳
SensorLine
Implements
Table of contents
Constructors
Properties
Accessors
Methods
Constructors
constructor
• new SensorLine(line): SensorLine
Line에서 새 SensorLine 인스턴스를 생성합니다. Position은 두 점의 중간지점으로 설정됩니다.
Parameters
| Name | Type |
|---|---|
line | Line |
Returns
Overrides
Sprite.constructor
Defined in
Properties
element
• element: HTMLDivElement
SensorLine의 DOM 엘리먼트입니다. div 엘리먼트로 그려집니다.
Overrides
Defined in
id
• Optional id: string
Sprite의 고유 ID입니다. mount되기 전에는 undefined입니다.
Inherited from
Defined in
pubsub
• pubsub: PubSub<{ move: (position: Point) => void }>
Sprite의 PubSub 인스턴스입니다. Position에 변화가 생기면 move 이벤트가 생성됩니다.
Inherited from
Defined in
stadium
• Optional stadium: Stadium
Sprite가 속한 Stadium 인스턴스입니다. mount되기 전에는 undefined입니다.
Inherited from
Defined in
TAG
▪ Static TAG: string = "sensorLine"
SensorLine의 태그입니다. 모든 SensorLine은 이 태그를 가집니다.
Defined in
Accessors
mounted
• get mounted(): boolean
Sprite가 mount 되었는지 여부를 반환합니다.
Returns
boolean
Inherited from
Sprite.mounted
Defined in
Methods
destroy
▸ destroy(): void
Sprite를 DOM에서 제거합니다.
Returns
void
Inherited from
Defined in
use
▸ use(hooks): void
새 Hook을 스프라이트에 추가합니다.
sprite.use([ new Hook() ])Parameters
| Name | Type |
|---|---|
hooks | Hook[] |
Returns
void