• Public
  • Public/Protected
  • All

The Notes Layer which contains Note canvas objects.





  • _activate(): void
  • _deactivate(): void
  • hintMapNotes(): void
  • Visually indicate in the Scene Controls that there are visible map notes present in the Scene.

    Returns void

  • panToNote(note: Note, [options]?: { scale: number; duration: number }): Promise<void>
  • Pan to a given note on the layer.


    • note: Note

      The note to pan to.

    • [options]: { scale: number; duration: number } = {}

      Options which modify the pan operation.

      • scale: number
      • duration: number

    Returns Promise<void>

    A Promise which resolves once the pan animation has concluded.

  • _onClickLeft(event: any): Promise<any>
  • getDocuments(): Document[]
  • Obtain an iterable of objects which should be added to this PlaceableLayer

    Returns Document[]

  • _draw(options: any): Promise<void>
  • _tearDown(options: any): Promise<void>
  • _sortObjectsByElevation(): void
  • clearPreviewContainer(): void
  • Get a PlaceableObject contained in this layer by its ID. Returns undefined if the object doesn't exist or if the canvas is not rendering a Scene.


    • objectId: string

      The ID of the contained object to retrieve

    Returns PlaceableObject

    The object instance, or undefined

  • Acquire control over all PlaceableObject instances which are visible and controllable within the layer.


    • options: any = {}

      Options passed to the control method of each object

    Returns PlaceableObject[]

    An array of objects that were controlled

  • releaseAll(options?: any): number
  • Release all controlled PlaceableObject instance from this layer.


    • options: any = {}

      Options passed to the release method of each object

    Returns number

    The number of PlaceableObject instances which were released

  • rotateMany(options?: { angle: number; delta: number; snap: number; ids: any[] }): Promise<PlaceableObject[]>
  • Simultaneously rotate multiple PlaceableObjects using a provided angle or incremental. This executes a single database operation using Scene.update. If rotating only a single object, it is better to use the PlaceableObject.rotate instance method.


    • options: { angle: number; delta: number; snap: number; ids: any[] } = {}

      Options which configure how multiple objects are rotated

      • angle: number
      • delta: number
      • snap: number
      • ids: any[]

    Returns Promise<PlaceableObject[]>

    An array of objects which were rotated

  • moveMany(options?: { dx: number; dy: number; rotate: boolean; ids: any[] }): Promise<PlaceableObject[]>
  • Simultaneously move multiple PlaceableObjects via keyboard movement offsets. This executes a single database operation using Scene.update. If moving only a single object, this will delegate to PlaceableObject.update for performance reasons.


    • options: { dx: number; dy: number; rotate: boolean; ids: any[] } = {}

      Options which configure how multiple objects are moved

      • dx: number
      • dy: number
      • rotate: boolean
      • ids: any[]

    Returns Promise<PlaceableObject[]>

    An array of objects which were moved during the operation

  • undoHistory(): Promise<Document[]>
  • Undo a change to the objects in this layer This method is typically activated using CTRL+Z while the layer is active

    Returns Promise<Document[]>

    An array of documents which were modified by the undo operation

  • deleteAll(): Promise<Document[]>
  • A helper method to prompt for deletion of all PlaceableObject instances within the Scene Renders a confirmation dialogue to confirm with the requester that all objects will be deleted

    Returns Promise<Document[]>

    An array of Document objects which were deleted by the operation

  • storeHistory(type: string, data: any[]): void
  • Record a new CRUD event in the history log so that it can be undone later


    • type: string

      The event type (create, update, delete)

    • data: any[]

      The object data

    Returns void

  • Copy currently controlled PlaceableObjects to a temporary Array, ready to paste back into the scene later

    Returns PlaceableObject[]

    The Array of copied PlaceableObject instances

  • pasteObjects(position: Point, [options]?: { hidden: boolean; snap: boolean }): Promise<Document[]>
  • Paste currently copied PlaceableObjects back to the layer by creating new copies


    • position: Point

      The destination position for the copied data.

    • [options]: { hidden: boolean; snap: boolean } = {}

      Options which modify the paste operation

      • hidden: boolean
      • snap: boolean

    Returns Promise<Document[]>

    An Array of created Document instances

  • selectObjects(__namedParameters?: number, __namedParameters?: number): boolean
  • Select all PlaceableObject instances which fall within a coordinate rectangle.


    • __namedParameters: number = {}
    • __namedParameters: number = {}

    Returns boolean

    A boolean for whether the controlled set was changed in the operation

  • updateAll(transformation: any, condition?: Function, options?: any): Promise<Document[]>
  • Update all objects in this layer with a provided transformation. Conditionally filter to only apply to objects which match a certain condition.


    • transformation: any

      An object of data or function to apply to all matched objects

    • condition: Function = null

      A function which tests whether to target each object

    • options: any = {}

    Returns Promise<Document[]>

    An array of updated data once the operation is complete

  • _onDragLeftStart(event: any): Promise<void>
  • _onDragLeftMove(event: any): void
  • _onDragLeftDrop(event: any): Promise<any>
  • _onDragLeftCancel(event: any): void
  • _onClickRight(event: any): void
  • _onDeleteKey(event: any): Promise<any>
  • Activate the InteractionLayer, deactivating other layers and marking this layer's children as interactive.


    • [options]: { tool: string } = {}

      Options which configure layer activation

      • tool: string

    Returns InteractionLayer

    The layer instance, now activated

  • getZIndex(): number
  • Get the zIndex that should be used for ordering this layer vertically relative to others in the same Container.

    Returns number

  • Draw the canvas layer, rendering its internal components and returning a Promise. The Promise resolves to the drawn layer once its contents are successfully rendered.


    • options: any = {}

    Returns Promise<CanvasLayer>

  • Deconstruct data used in the current layer in preparation to re-draw the canvas


    • options: any = {}

    Returns Promise<CanvasLayer>

  • _onDropData(event: DragEvent, data: any): Promise<any>
  • Handle JournalEntry document drop data


    • event: DragEvent

      The drag drop event

    • data: any

      The dropped data transfer data

    Returns Promise<any>

  • _canvasCoordinatesFromDrop(event: DragEvent, __namedParameters?: any): boolean | number[]
  • Get the world-transformed drop position.


    • event: DragEvent
    • __namedParameters: any = {}

    Returns boolean | number[]

    Returns the transformed x, y co-ordinates, or false if the drag event was outside the canvas.

  • _createPreview(createData: any, position: { top: number; left: number }): Promise<any>
  • Create a preview of this layer's object type from a world document and show its sheet so it can be finalized.


    • createData: any

      The data to create the object with.

    • position: { top: number; left: number }

      The position to render the sheet at.

      • top: number
      • left: number

    Returns Promise<any>

  • _onClickLeft2(event: InteractionEvent): void
  • registerSettings(): void
  • Register game settings used by the NotesLayer

    Returns void


interactiveChildren: boolean
objects: any = null

Placeable Layer Objects

preview: any = null

Preview Object Placement

history: CanvasHistory[] = []

Keep track of history so that CTRL+Z can undo changes

_highlight: boolean = false

Track whether "highlight all objects" is currently active

_copy: PlaceableObject[] = []

Keep track of an object copied with CTRL+C which can be pasted later

quadtree: Quadtree = ...

A Quadtree which partitions and organizes Walls into quadrants for efficient target identification.

visible: boolean
sortDirty: boolean
zIndex: number
interactive: boolean
hitArea: any
options: { name: string } = ...

Options for this layer instance.

Type declaration

  • name: string
renderable: boolean
#hover: any = null
documentName: string = "Note"

A reference to the named Document type which is contained within this Canvas Layer.

TOGGLE_SETTING: string = "notesDisplayToggle"

The named core setting which tracks the toggled visibility state of map notes

CREATION_STATES: { NONE: number; POTENTIAL: number; CONFIRMED: number; COMPLETED: number } = ...

Creation states affected to placeables during their construction.

Type declaration

  • NONE: number
  • POTENTIAL: number
  • CONFIRMED: number
  • COMPLETED: number


  • get documentCollection(): any
  • Obtain a reference to the Collection of embedded Document instances within the currently viewed Scene

    Returns any

  • get gridPrecision(): number
  • Return the precision relative to the Scene grid with which Placeable objects should be snapped

    Returns number

  • If objects on this PlaceableLayer have a HUD UI, provide a reference to its instance

    Returns BasePlaceableHUD

  • A convenience method for accessing the placeable object instances contained in this layer

    Returns PlaceableObject[]

  • An Array of placeable objects in this layer which have the _controlled attribute

    Returns PlaceableObject[]

  • Track the set of PlaceableObjects on this layer which are currently controlled.

    Returns Map<string, PlaceableObject>

  • Track the PlaceableObject on this layer which is currently hovered upon.

    Returns PlaceableObject

  • Track the PlaceableObject on this layer which is currently hovered upon.


    Returns void

  • get active(): boolean
  • Is this layer currently active

    Returns boolean

  • get name(): string
  • The canonical name of the CanvasLayer

    Returns string

  • get layerOptions(): any
  • inheritdoc

    Returns any

  • get placeableClass(): Function
  • Obtain a reference to the PlaceableObject class definition which represents the Document type in this layer.

    Returns Function

  • Return a reference to the active instance of this canvas layer

    Returns CanvasLayer