PrivateconfigurationThe event listeners for the configuration mode. These are used to remove the event listeners when the configuration mode is disabled.
PrivatedraggingThe element that is currently being dragged
Whether the user is currently configuring the touch controls. When this is true, the touch controls can be dragged around the screen and the controls of the game are disabled.
PrivateisPrivateoverlayPrivatetouchPrivatechangeChanges the state of the touch controls to the given orientation.
Whether the screen is in landscape mode.
PrivatecreateCreates the event listeners for the configuration mode.
The elements that can be dragged around the screen.
The event listeners for the configuration mode.
PrivatecreateCreates an overlay that covers the screen and allows the user to drag the touch controls around. Also enables the toolbar for saving, resetting, and canceling the changes.
The UI of the game.
PrivatecreateInitializes the toolbar of the configuration mode. Places its elements at the top of the touch controls and adds event listeners to them.
PrivatecreateCreates the toolbar element for the configuration mode.
A new div element that contains the toolbar for the configuration mode.
Disables the configuration mode.
PrivatedragDrags the currently dragged element to the given pointer position.
The pointer event that is currently happening.
Allows the user to configure the touch controls by dragging buttons around the screen.
The UI of the game.
PrivategetReturns the references to the elements of the configuration toolbar.
The references to the elements of the configuration toolbar or undefined if the elements can not be found (e.g. during tests)
PrivategetReturns all control groups of the touch controls. These are groups of buttons that can be dragged around the screen.
All control groups of the touch controls.
PrivategetReturns the key of the local storage for the control positions data of this orientation
PrivategetReturns the current positions of all touch controls that have moved from their default positions of this orientation.
The current positions of all touch controls that have moved from their default positions of this orientation
PrivategetReturns the saved positions of the touch controls. Filters result by the given orientation.
The saved positions of the touch controls of this orientation
PrivategetPrivateisElements that are inside the left div are anchored to the left boundary of the screen. The x value of the positions are considered offsets to their respective boundaries.
Either an element in the left div or the right div.
Whether the given element is inside the left div.
PrivateresetResets the positions of the touch controls to their default positions and clears the saved positions. Does not save the changes.
PrivatesaveSaves the current positions of the touch controls to the local storage.
PrivatesetSets a control element to the given position. The x values are either offsets to the left or right boundary of the screen, depending on the side of the element. E.g. For left elements, (0, 0) is the bottom left corner of the screen and for right elements, (0, 0) is the bottom right corner of the screen.
Either an offset to the left or right boundary of the screen.
An offset to the bottom boundary of the screen.
PrivatesetUpdates the positions of the touch controls.
The new positions of the touch controls.
PrivatestartStart dragging the given button.
The button that is being dragged.
PrivatestopStops dragging the currently dragged element.
Handles the dragging of touch controls around the screen.