[**SixL server API**](../../README.md)

***

[SixL server API](../../README.md) / [world-entities](../README.md) / TextLabelMpPool

# Interface: TextLabelMpPool

The pool of text labels: `mp.labels`.

## Example

```ts
mp.labels.forEach((l) => l.destroy());
```

## Extends

- [`BasicMpPool`](../../entity/interfaces/BasicMpPool.md)\<[`TextLabelMp`](TextLabelMp.md)\>

## Properties

### length

> `readonly` **length**: `number`

The number of entities in the pool.

#### Example

```ts
const count = mp.blips.length;
```

#### Inherited from

[`BasicMpPool`](../../entity/interfaces/BasicMpPool.md).[`length`](../../entity/interfaces/BasicMpPool.md#length)

## Methods

### at()

> **at**(`id`): [`TextLabelMp`](TextLabelMp.md)

Finds an entity by id.

#### Parameters

##### id

`number`

The entity's id.

#### Returns

[`TextLabelMp`](TextLabelMp.md)

The entity, or `null` when there is none.

#### Example

```ts
const blip = mp.blips.at(1);
```

#### Inherited from

[`BasicMpPool`](../../entity/interfaces/BasicMpPool.md).[`at`](../../entity/interfaces/BasicMpPool.md#at)

***

### exists()

> **exists**(`entity`): `boolean`

Whether an entity (or an id) is still in the pool.

#### Parameters

##### entity

`number` \| [`TextLabelMp`](TextLabelMp.md)

An entity or its id.

#### Returns

`boolean`

True when it exists.

#### Example

```ts
if (mp.blips.exists(blip)) { }
```

#### Inherited from

[`BasicMpPool`](../../entity/interfaces/BasicMpPool.md).[`exists`](../../entity/interfaces/BasicMpPool.md#exists)

***

### forEach()

> **forEach**(`callingFunction`): `void`

Calls a function for every entity.

#### Parameters

##### callingFunction

(`entity`) => `void`

Called with each entity.

#### Returns

`void`

#### Example

```ts
mp.blips.forEach((b) => b.destroy());
```

#### Inherited from

[`BasicMpPool`](../../entity/interfaces/BasicMpPool.md).[`forEach`](../../entity/interfaces/BasicMpPool.md#foreach)

***

### forEachFast()

> **forEachFast**(`callingFunction`): `void`

Calls a function for every entity; the same as `forEach` in SixL.

#### Parameters

##### callingFunction

(`entity`) => `void`

Called with each entity.

#### Returns

`void`

#### Example

```ts
mp.blips.forEachFast((b) => b.destroy());
```

#### Inherited from

[`BasicMpPool`](../../entity/interfaces/BasicMpPool.md).[`forEachFast`](../../entity/interfaces/BasicMpPool.md#foreachfast)

***

### new()

> **new**(`text`, `position`, `options?`): [`TextLabelMp`](TextLabelMp.md)

Creates a text label.

#### Parameters

##### text

`string`

The text.

##### position

[`Vector3`](../../common/interfaces/Vector3.md)

Where (metres).

##### options?

Optional: `color` (an `[r, g, b, a]` array or `{ r, g, b, a }`; default white), `dimension`
(0), `drawDistance` (metres, 20), `font` (0) and `los` (false).

###### color?

[`Array4d`](../../common/type-aliases/Array4d.md)

###### dimension?

`number`

###### drawDistance?

`number`

###### font?

`number`

###### los?

`boolean`

#### Returns

[`TextLabelMp`](TextLabelMp.md)

The label.

#### Remarks

Partial: see [TextLabelMp](TextLabelMp.md).

#### Example

```ts
const label = mp.labels.new('Hello', new mp.Vector3(0, 0, 71), { los: true });
```

***

### toArray()

> **toArray**(): [`TextLabelMp`](TextLabelMp.md)[]

A snapshot of all entities.

#### Returns

[`TextLabelMp`](TextLabelMp.md)[]

A new array; changing it does not change the pool.

#### Example

```ts
const all = mp.blips.toArray();
```

#### Inherited from

[`BasicMpPool`](../../entity/interfaces/BasicMpPool.md).[`toArray`](../../entity/interfaces/BasicMpPool.md#toarray)
