The Ruler - used to measure distances and trigger movements
Record the User which this Ruler references
The ruler name - used to differentiate between players
The ruler color - by default the color of the active user
This Array tracks individual waypoints along the ruler's measured path. The first waypoint is always the origin of the route.
The Ruler element is a Graphics instance which draws the line and points of the measured path
The Labels element is a Container of Text elements which label the measured path
Track the current measurement state
The current destination point at the end of the measurement
The array of most recently computed ruler measurement segments
An enumeration of the possible Ruler measurement states.
Is the Ruler being actively used to measure distance?
Get a GridHighlight layer for this Ruler
Clear display of the current Ruler
Measure the distance between two points and render the ruler UI to illustrate it
The destination point to which to measure
Restrict measurement only to grid spaces
The array of measured segments
Determine whether a SPACE keypress event entails a legal token movement along a measured ruler
An indicator for whether a token was successfully moved or not. If True the event should be prevented from propagating further, if False it should move on to other handlers.
Handle the beginning of a new Ruler measurement workflow
The drag start event
Handle left-click events on the Canvas during Ruler measurement.
The pointer-down event
Handle right-click events on the Canvas during Ruler measurement.
The pointer-down event
Continue a Ruler measurement workflow for left-mouse movements on the Canvas.
The mouse move event
Conclude a Ruler measurement workflow by releasing the left-mouse button.
The pointer-up event
Package Ruler data to an object which can be serialized to a string.
Update a Ruler instance using data provided through the cursor activity socket
Ruler data with which to update the display
While measurement is in progress, update the destination to be the central point of the target grid space.
The current pixel coordinates of the mouse movement
The destination point, a center of a grid space
Translate the waypoints and destination point of the Ruler into an array of Ray segments.
The segments of the measured path
Compute the distance of each segment and the total distance of the measured path.
Base distance on the number of grid spaces moved?
Get the text label for a segment of the measured path
Draw each segment of the measured path.
Highlight the measurement required to complete the move in the minimum number of discrete spaces
Acquire a Token, if any, which is eligible to perform a movement based on the starting point of the Ruler
Animate piecewise Token movement along the measured segment path.
The Token being animated
A Promise which resolves once all animation is completed
Update Token position and configure its animation properties for the next leg of its animation.
The Token being updated
The measured segment being moved
The adjusted destination coordinate
A Promise which resolves once the animation for this segment is done
Handle the addition of a new waypoint in the Ruler measurement path
Handle the removal of a waypoint in the Ruler measurement path
The current cursor position to snap to
Snap exactly to grid spaces?
Handle the conclusion of a Ruler measurement workflow