Internal
_updatedTrack whether we have pending fog updates which have not yet been saved to the database
The FogExploration document which applies to this canvas view
Static
COMMIT_Define the number of fog refresh needed before the fog texture is extracted and pushed to the server.
Static
emittedTexture extractor
Does the currently viewed Scene support fog of war exploration?
The exploration SpriteMesh which holds the fog exploration texture.
The configured options used for the saved fog-of-war texture.
Does the currently viewed Scene support Token field of vision?
Internal
Create the exploration display object with or without a provided texture.
Optional
tex: Texture<Resource> | RenderTextureOptional exploration texture.
Internal
If fog of war data is reset from the server, deactivate the current fog and initialize the exploration.
Add a new event listener for a certain type of event.
The type of event being registered for
The listener function called when the event occurs
Optional
options: { once?: boolean } = {}Options which configure the event listener
Optional
once?: booleanShould the event only be responded to once and then removed
Clear the fog and reinitialize properties (commit and save in non reset mode)
Once a new Fog of War location is explored, composite the explored container with the current staging sprite. Once the number of refresh is > to the commit threshold, save the fog texture to the database.
Destroy this FogManager.
Dispatch an event on this target.
The Event to dispatch
Was default behavior for the event prevented?
Initialize fog of war - resetting it when switching scenes or re-drawing the canvas
Is this position explored?
The position to be tested
Is this position explored?
Load existing fog of war data from local storage and populate the initial exploration sprite
Remove an event listener for a certain type of event.
The type of event being removed
The listener function being removed
Dispatch a request to reset the fog of war exploration status for all users within this Scene. Once the server has deleted existing FogExploration documents, the _onReset handler will re-draw the canvas.
Request a fog of war save operation. Note: if a save operation is pending, we're waiting for its conclusion.
Synchronize one user's version of the Fog of War for this scene to other users. Note: This API is experimental and may be removed in later versions without deprecation. It is intended for one-time corrections of users' fog explorations, and should not be used for real-time synchronization of fog exploration.
The user whose Fog of War to use as the source of truth.
Optional
to: User[]A list of users that should have their Fog of War synced. If none are specified then all users will be synced.
A promise that resolves when synchronization has been completed.
Protected
_extractProtected
Extract fog data as a base64 string
Protected
_prepareProtected
Prepare the data that will be used to update the FogExploration document.
The extracted base64 image data
Exploration data to update
A fog of war management class which is the singleton canvas.fog instance.
See