Global

Members

(constant) areObjectsEqual

Deeply compares two objects for equality
Source:

(constant) areTwoLinesCollided

Determines if two line segments are collided
Source:

(constant) areTwoRectsCollided

Determines if two rectangles are collided
Source:

(constant) arraySet

Sets values from a source array into a target array starting from a specified index
Source:

blur :number

Set/Get blur value
Type:
  • number
Source:

(constant) clamp

Clamps a value between a minimum and maximum
Source:

(constant) clone

Deep clones an object or array
Source:

(constant) coordToVector

Converts a coordinate to a vector index
Source:

(constant) cross

+ * Calculates the cross product of two 2D vectors + * @param {object} a The first vector with x and y properties + * @param {object} b The second vector with x and y properties + * @returns {number} The cross product of the two vectors +
Source:

(constant) crossFadeAudioVolumes

Crossfades the volume between two audio items based on step
Source:

(constant) distanceBetweenPointAndLine

Calculates the shortest distance between a point and a line segment
Source:

(constant) dot

Calculates the dot product of two 2D vectors
Source:

(constant) enterFrame

Creates an enter frame loop that calls a callback function at a specified FPS limit
Source:

(constant) enumCheck

Checks if a specific bit is set in an enum value
Source:

(constant) fadeAudioVolume

Fades the volume of an audio item between min and max based on step
Source:

(constant) fract

Returns the fractional part of a number
Source:

(constant) generateDungeon

Generates a dungeon layout by randomly placing rooms and resolving collisions
Source:

(constant) getFPS

Returns the current frames per second (FPS)
Source:

(constant) getRandom

Returns a random item from an array
Source:

(constant) hashNoise2D

Hash-based 2D noise function
Source:

level :number

Gets or sets the water level (green channel of the backdrop)
Type:
  • number
Source:

(constant) lineToLineIntersection

Calculates the intersection point of two line segments if they collide
Source:

(constant) mix

Mixes two values based on a third value
Source:

(constant) noop

A no-operation function
Source:

(constant) noopReturnsWith

Returns a function that always returns the given value
Source:

(constant) nthCall

Call a function every nth call
Source:

(constant) rectToRectIntersection

Calculates the intersection rectangle of two rectangles if they collide
Source:

(constant) removeFromArray

Remove an item from an array
Source:

scale :number

Gets or sets the scale of the water displacement
Type:
  • number
Source:

speed :number

Gets or sets the speed of the water animation
Type:
  • number
Source:

(constant) stepNoise

Step noise function
Source:

(constant) vectorToCoord

Converts a vector index to a coordinate
Source:

Methods

render(delay)

Renders the animated water effect
Parameters:
Name Type Description
delay number The time delay since the last render
Source:

render()

Render
Source:

setSize(w, h)

Sets the size of the animated water effect
Parameters:
Name Type Description
w number The width
h number The height
Source:

setSize(w, h)

Set Renderer Size
Parameters:
Name Type Description
w number
h number
Source:

Type Definitions

DataObserver

DataObserver utility
Type:
  • Object
Properties:
Name Type Description
state Object Proxy state object
flush function Flush changes and get the updated state
Source:

FPS

FPS counter utility
Type:
  • Object
Properties:
Name Type Description
init function noop function for backward compatibility
start function noop function for backward compatibility
update function Update counter
Source:

SmoothLightRendererConfig

Type:
  • Object
Properties:
Name Type Description
blur number
Source: