Skip to main content

MiniMap

A class representing a 2D minimap of a 3D world.

Implements

Properties

backgroundColor

backgroundColor: Color

The background color of the minimap. It is used to set the background color of the minimap's renderer.


config

config: MiniMapConfigManager

Configurable.config

Implementation of

Configurable . config


enabled

enabled: boolean = true

A flag indicating whether the minimap is enabled. If disabled, the minimap will not update or render.


frontOffset

frontOffset: number = 0

The front offset of the minimap. It determines how much the minimap's view is offset from the camera's view. By pushing the map to the front, what the user sees on screen corresponds with what they see on the map


isSetup

isSetup: boolean = false

Configurable.isSetup

Implementation of

Configurable . isSetup


onAfterUpdate

readonly onAfterUpdate: Event<unknown>

Updateable.onAfterUpdate

Implementation of

Updateable . onAfterUpdate


onBeforeUpdate

readonly onBeforeUpdate: Event<unknown>

Updateable.onBeforeUpdate

Implementation of

Updateable . onBeforeUpdate


onDisposed

readonly onDisposed: Event<unknown>

Disposable.onDisposed

Implementation of

Disposable . onDisposed


onResize

readonly onResize: Event<Vector2>

Resizeable.onResize

Implementation of

Resizeable . onResize


onSetup

readonly onSetup: Event<unknown>

Configurable.onSetup

Implementation of

Configurable . onSetup


overrideMaterial

overrideMaterial: MeshDepthMaterial

The override material for the minimap. It is used to render the depth information of the world onto the minimap.


renderer

renderer: WebGLRenderer

The WebGL renderer for the minimap. It is used to render the minimap onto the screen.


world

world: World

The world in which the minimap is displayed. It provides access to the 3D scene, camera, and other relevant world elements.

Accessors

lockRotation

get lockRotation(): boolean

Gets or sets whether the minimap rotation is locked. When rotation is locked, the minimap will always face the same direction as the camera.

set lockRotation(active): void

Sets whether the minimap rotation is locked. When rotation is locked, the minimap will always face the same direction as the camera.

Parameters

ParameterTypeDescription
activebooleanIf true, rotation is locked. If false, rotation is not locked.

Returns

boolean


zoom

get zoom(): number

Gets the current zoom level of the minimap. The zoom level determines how much of the world is visible on the minimap.

set zoom(value): void

Sets the zoom level of the minimap. The zoom level determines how much of the world is visible on the minimap.

Parameters

ParameterTypeDescription
valuenumberThe new zoom level of the minimap.

Returns

number

The current zoom level of the minimap.

Methods

dispose()

dispose(): void

Disposable.dispose

Returns

void

Implementation of

Disposable . dispose


get()

get(): OrthographicCamera

Returns the camera used by the MiniMap

Returns

OrthographicCamera


getSize()

getSize(): Vector2

Resizeable.getSize

Returns

Vector2

Implementation of

Resizeable . getSize


resize()

resize(size): void

Resizeable.resize

Parameters

ParameterType
sizeVector2

Returns

void

Implementation of

Resizeable . resize


setup()

setup(config?): void

Configurable.setup

Parameters

ParameterType
config?Partial <MiniMapConfig>

Returns

void

Implementation of

Configurable . setup


update()

update(): void

Updateable.update

Returns

void

Implementation of

Updateable . update