Italic font name
The directions angles
Element colors
Element colors in battle
Element names
Default elements order
8-Directional direction keys
Changes the brightness of a given color code.
the input color in hex.
how much the brightness should change.
returns the new color in hex.
Given a direction, returns this direction and its adjacent directions.
the direction value.
Returns the range of the given direction.
Gets the center position of a tile in pixels.
the tile position.
the tile size.
centered tile position in pixels.
Generate a mask for the given direction. Examples:
The direction to generate the mask.
Returns the mask.
Lists all directions, diagonals optional.
If true, includes diagonals.
Returns the directions.
Calculates the distance between two points.
source x position.
dest x position.
source y position.
dest y position.
return the distance value.
Given a direction and a current position, returns the next front position.
x tile position.
y tile position.
the direction that's going towards.
if true, returns null on diagonal input. Otherwise, returns input as is.
the front position.
Transforms a direction into a non diagonal direction.
the input direction.
returns the non diagonal direction.
Returns the opposite of the given direction.
Direction value
Opposite direction value
Gets the px position of a given position in tile.
the tile size.
returns the px position.
Calculates the squared distance between two points.
source x position.
dest x position.
source y position.
dest y position.
return the squared distance value.
Returns the surrounding positions. Diagonals are optional.
the x reference position.
the y reference position.
if true, includes diagonals.
how distant if the surrounding positions from the given position.
Returns the surrounding positions.
Obtains the text width in pixels (INEFFICIENT).
the Phaser.Game instance
the text string to measure width
whether the text is in italic
Gets the tile position of a given position in px.
the position in px.
the tile size.
returns the tile position.
Gets the directions between the current direction and a desired/target direction. Example of transition between left and right: left -> up left -> up -> up right -> right.
Current direction value
Desired/Target direction value
The direction value to apply
Gets the direction of a given vector.
x source pos.
x dest pos.
y source pos.
y dest pos.
The direction of the given vector.
Converts a color from hex to rgb.
the color in hex format.
the color in rgb format.
Transforms HSV color into RGB color
hue channel color value
saturation channel color value
value channel color value
returns the color in RGB
Returns the diagonal value for its component directions Example: Input: 6, 0 (up, right) / Output: 7 (up_right)
Direction values
Direction values
Diagonal direction value
Creates a collision polygon.
Width of the body
Shift value
Body's bevel value
Returns a list of coodinates of the polygon.
Advances a step in a given direction.
the current x pos in px.
the current x pos in px.
the step distance.
the angle of the new direction.
Returns the new x and y position.
Convert a string to a PIXI.blendModes
enum value
Desired blend mode string
returns a PIXI.blendModes
enum value
Promised way to create and wait a Phaser.Timer. Waits for the amount of time given.
the Phaser game object.
the time in ms.
on timer finish callback.
Standard Normal variate using Box-Muller transform. Mean = 0, variance = 1.
returns a normal pseudo-random number.
Places the angle (radians) in the [0,2*PI[ range.
any angle in radians.
Angle in the [0,2*PI[ range.
Transforms RGB color into HSV color.
red channel color value [0, 255]
green channel color value [0, 255]
blue channel color value [0, 255]
returns the color in HSV
Splits an diagonal direction into component cardinal directions.
the input diag direction.
The x and y component cardinal directions.
Returns the direction values for diagonal directions Example: Input: 7 (up_right) / Output: [6,0]
Diagonal direction value
Array with split direction values
Returns a random number from 0 to 4.
Random number from 0 to 4
Picks an item from an input array randomly based on weights list. Items and weights array must agree.
array of items to has one element picked.
weights for each element of items array.
returns one element of items.
Generated using TypeDoc
Default font name