# Class Flashlight

- Defined in drawables/lights/flashlight.ts:8

##### Index

### Constructors

constructor

### Properties

center
color
direction
intensity
lightnessRatio
startCutoff
descriptor

### Methods

getObjectToSerialize
minDistance
setLightnessRatio

## Constructors

### constructor

- new Flashlight(
  center: vec2,
  color: vec3,
  intensity: number,
  direction: vec2,
  startCutoff?: number,
  ): Flashlight

  #### Parameters

  - center: vec2
  - color: vec3
  - intensity: number
  - direction: vec2
  - startCutoff: number = 0

  #### Returns Flashlight

  Overrides LightDrawable.constructor

  - Defined in drawables/lights/flashlight.ts:22

## Properties

### center

center: vec2

Inherited from LightDrawable.center

- Defined in drawables/lights/light-drawable.ts:9

### color

color: vec3

Inherited from LightDrawable.color

- Defined in drawables/lights/light-drawable.ts:10

### direction

direction: vec2

- Defined in drawables/lights/flashlight.ts:26

### intensity

intensity: number

Inherited from LightDrawable.intensity

- Defined in drawables/lights/light-drawable.ts:11

### `Protected` lightnessRatio

lightnessRatio: number = 1

Inherited from LightDrawable.lightnessRatio

- Defined in drawables/lights/light-drawable.ts:6

### startCutoff

startCutoff: number = 0

- Defined in drawables/lights/flashlight.ts:27

### `Static` `Readonly` descriptor

descriptor: DrawableDescriptor = ...

This should be defined in inherited classes.

Overrides LightDrawable.descriptor

- Defined in drawables/lights/flashlight.ts:9

## Methods

### `Protected` getObjectToSerialize

- getObjectToSerialize(transform2d: mat2d, transform1d: number): any

  #### Parameters

  - transform2d: mat2d
  - transform1d: number

  #### Returns any

  Overrides LightDrawable.getObjectToSerialize

  - Defined in drawables/lights/flashlight.ts:32

### minDistance

- minDistance(target: vec2): number

  The lower bound of the distance between the target and the object.

  It can return 0 by default; the only consequence is reduced performance, because this object won't benefit from tile-based rendering.

  #### Parameters

  - target: vec2

  #### Returns number

  Inherited from LightDrawable.minDistance

  - Defined in drawables/lights/light-drawable.ts:20

### setLightnessRatio

- setLightnessRatio(ratio: number): void

  #### Parameters

  - ratio: number

  #### Returns void

  Inherited from LightDrawable.setLightnessRatio

  - Defined in drawables/lights/light-drawable.ts:16