crosshairs

Crosshairs methods

Details

Methods


<static> collect( crosshairsData [, types [, containedFilter ] ] ) → {Object.<String, PlaceableObject>}

Description

Returns desired types of placeables whose center point is within the crosshairs radius.

Parameters
Name Type Attributes Default Description
crosshairsData Object

Requires at least {x,y,radius,parent} (all in pixels, parent is a Scene)

types String | Array.<String> <optional>
'Token'

Collects the desired embedded placeable types.

containedFilter function <optional>
Gateway._containsCenter

Optional function for determining if a placeable is contained by the crosshairs. Default function tests for centerpoint containment. Gateway._containsCenter

Returns

List of collected placeables keyed by embeddedName

Details

<static> getTag( key ) → {PIXI.DisplayObject|undefined}

Description

Will retrieve the active crosshairs instance with the defined tag identifier.

Parameters
Name Type Description
key string

Crosshairs identifier. Will be compared against the Crosshairs tag field for strict equality.

Returns
Details

<async, static> show( [ config [, callbacks ] ] ) → {Promise.<CrosshairsData>}

Description

Displays a circular template attached to the mouse cursor that snaps to grid centers and grid intersections.

Its size is in grid squares/hexes and can be scaled up and down via shift+mouse scroll. Resulting data indicates the final position and size of the template. Note: Shift+Scroll will increase/decrease the size of the crosshairs outline, which increases or decreases the size of the token spawned, independent of other modifications.

Parameters
Name Type Attributes Description
config CrosshairsConfig <optional>

Configuration settings for how the crosshairs template should be displayed.

callbacks Object <optional>

Functions executed at certain stages of the crosshair display process.

Name Type Attributes Description
show ParallelShow <optional>
Returns

All fields contained by MeasuredTemplateDocument#toObject. Notably x, y, width (in pixels), and the addition of size (final size, in grid units, e.g. "2" for a final diameter of 2 squares).

Details