MiniMap
A class representing a 2D minimap of a 3D world.
Implements
Resizeable
Updateable
Disposable
Configurable
<MiniMapConfigManager
,MiniMapConfig
>
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
Implementation of
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
Implementation of
onAfterUpdate
readonly
onAfterUpdate:Event
<unknown
>
Implementation of
onBeforeUpdate
readonly
onBeforeUpdate:Event
<unknown
>
Implementation of
onDisposed
readonly
onDisposed:Event
<unknown
>
Implementation of
onResize
readonly
onResize:Event
<Vector2
>
Implementation of
onSetup
readonly
onSetup:Event
<unknown
>
Implementation of
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
Parameter | Type | Description |
---|---|---|
active | boolean | If 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
Parameter | Type | Description |
---|---|---|
value | number | The new zoom level of the minimap. |
Returns
number
The current zoom level of the minimap.
Methods
dispose()
dispose():
void
Returns
void
Implementation of
get()
get():
OrthographicCamera
Returns the camera used by the MiniMap
Returns
OrthographicCamera
getSize()
getSize():
Vector2
Returns
Vector2
Implementation of
resize()
resize(
size
):void
Parameters
Parameter | Type |
---|---|
size | Vector2 |
Returns
void
Implementation of
setup()
setup(
config
?):void
Parameters
Parameter | Type |
---|---|
config ? | Partial <MiniMapConfig > |
Returns
void
Implementation of
update()
update():
void
Returns
void