Options
All
  • Public
  • Public/Protected
  • All
Menu

Index

Functions

  • acosh(arg: number): number
  • Hyperbolic arc-cosine

    Parameters

    • arg: number

      Value.

    Returns number

    The hyperbolic arc-cosine for the value.

  • angleBetweenPositions(x1: number, y1: number, x2: number, y2: number): number
  • Returns the angle, in degrees, between two positions.

    Parameters

    • x1: number

      First point X position.

    • y1: number

      First point Y position.

    • x2: number

      Second point X position.

    • y2: number

      Second point Y position.

    Returns number

    The angle between the positions, in degrees.

  • angleDifference(angle1: number, angle2: number): number
  • Returns the difference between two angles, in degrees.

    Parameters

    • angle1: number

      First angle, in degrees.

    • angle2: number

      Second angle, in degrees.

    Returns number

    Return the difference of the angles, in degrees.

  • asinh(arg: number): number
  • Hyperbolic arcsine

    Parameters

    • arg: number

      Value.

    Returns number

    The hyperbolic arcsine for the value.

  • atanh(arg: number): number
  • Hyperbolic arctangent

    Parameters

    • arg: number

      Value.

    Returns number

    The hyperbolic arctangent for the value.

  • cbrt(x: number): number
  • Cube root

    Parameters

    • x: number

      Value.

    Returns number

    Return the cube root for the value.

  • ceilTo(value: number, decimalPlace: number): number
  • Rounds up a number to the Nth decimal place

    Parameters

    • value: number
    • decimalPlace: number

    Returns number

    the rounded value

  • clamp(x: number, min: number, max: number): number
  • Limit a value to a range.

    Parameters

    • x: number

      Value.

    • min: number

      The minimum value.

    • max: number

      The maximum value.

    Returns number

    The new value.

  • cosh(arg: number): number
  • Hyperbolic cosine

    Parameters

    • arg: number

      Value.

    Returns number

    The hyperbolic cosine for the value.

  • cot(arg: number): number
  • Cotangent

    Parameters

    • arg: number

      Value.

    Returns number

    The cotangent for the value.

  • csc(arg: number): number
  • Cosecant

    Parameters

    • arg: number

      Value.

    Returns number

    The cosecant for the value.

  • distanceBetweenPositions(x1: number, y1: number, x2: number, y2: number): number
  • Returns the distance, in pixels, between two positions.

    Parameters

    • x1: number

      First point X position.

    • y1: number

      First point Y position.

    • x2: number

      Second point X position.

    • y2: number

      Second point Y position.

    Returns number

    The distance between the positions, in pixels.

  • floorTo(value: number, decimalPlace: number): number
  • Rounds down a number to the Nth decimal place

    Parameters

    • value: number
    • decimalPlace: number

    Returns number

    the rounded value

  • getVariableBoolean(variable: Variable, compareWith: boolean): boolean
  • deprecated

    Parameters

    Returns boolean

  • getVariableChildCount(variable: Variable): number
  • deprecated

    Parameters

    Returns number

  • getVariableNumber(variable: Variable): number
  • deprecated

    Parameters

    Returns number

  • getVariableString(variable: Variable): string
  • deprecated

    Parameters

    Returns string

  • getXFromAngleAndDistance(angle: number, distance: number): number
  • Compute the X position when given an angle and distance relative to the origin (0;0). This is also known as getting the cartesian coordinates of a 2D vector, using its polar coordinates.

    Parameters

    • angle: number

      The angle, in degrees.

    • distance: number

      The distance from the object, in pixels.

    Returns number

  • getYFromAngleAndDistance(angle: number, distance: number): number
  • Compute the Y position when given an angle and distance relative to the origin (0;0). This is also known as getting the cartesian coordinates of a 2D vector, using its polar coordinates.

    Parameters

    • angle: number

      The angle, in degrees.

    • distance: number

      The distance from the object, in pixels.

    Returns number

  • isMobile(): boolean
  • Check if the game runs on a mobile device (iPhone, iPad, Android). Note that the distinction between what is a mobile device and what is not is becoming blurry. If you use this for mobile controls, prefer to check if the device has touchscreen support.

    Returns boolean

  • lerp(a: number, b: number, x: number): number
  • Runs a linear interpolation between a and b.

    Parameters

    • a: number

      Start value.

    • b: number

      End value.

    • x: number

      The interpolation value between 0 and 1.

    Returns number

    The interpolated value, now between a and b.

  • lerpAngle(angle1: number, angle2: number, x: number): number
  • Linearly interpolates between two angles (in degrees) by taking the shortest direction around the circle.

    Parameters

    • angle1: number

      Starting angle, in degrees.

    • angle2: number

      Destination angle, in degrees.

    • x: number

      The interpolation value between 0 and 1.

    Returns number

    Return the interpolated angle, in degrees.

  • log10(arg: number): number
  • Base-10 logarithm

    Parameters

    • arg: number

      Value.

    Returns number

    The base-10 logarithm for the value.

  • log2(arg: number): number
  • Base-2 logarithm

    Parameters

    • arg: number

      Value.

    Returns number

    The base-2 logarithm for the value.

  • logicalNegation(bool: boolean): boolean
  • Negate the boolean.

    Parameters

    • bool: boolean

      The boolean to negate.

    Returns boolean

    The negated value.

  • mod(x: number, y: number): number
  • Modulo operation (the remainder after dividing one number by another)

    Parameters

    • x: number

      Dividend value.

    • y: number

      Divisor value.

    Returns number

    Return the remainder for the values.

  • normalize(val: number, min: number, max: number): number
  • Normalize a value between min and max to a value between 0 and 1.

    Parameters

    • val: number

      The value to normalize

    • min: number

      The minimum

    • max: number

      The maximum

    Returns number

    The normalized value between 0 and 1

  • nthroot(x: number, n: number): number
  • N-th root

    Parameters

    • x: number

      Base value.

    • n: number

      Exponent value.

    Returns number

    Return the n-th root for the value.

  • pi(): number
  • Pi 3.1415...

    Returns number

    the Pi number

  • resolveAsyncEventsFunction(eventsFunctionContext: EventsFunctionContext): void
  • Parameters

    • eventsFunctionContext: EventsFunctionContext

    Returns void

  • roundTo(value: number, decimalPlace: number): number
  • Rounds a number to the Nth decimal place

    Parameters

    • value: number
    • decimalPlace: number

    Returns number

    the rounded value

  • sceneVariableExists(runtimeScene: RuntimeScene, variableName: string): boolean
  • deprecated

    Parameters

    Returns boolean

  • sec(arg: number): number
  • Secant

    Parameters

    • arg: number

      Value.

    Returns number

    The secant for the value.

  • setVariableBoolean(variable: Variable, newValue: boolean): void
  • deprecated

    Parameters

    Returns void

  • sign(arg: number): number
  • Returns the sign of the number. This checks if the value is positive, negative or zero.

    Parameters

    • arg: number

      Value.

    Returns number

    Return the sign for the value (1, -1 or 0).

  • sinh(arg: number): number
  • Hyperbolic sine

    Parameters

    • arg: number

      Value.

    Returns number

    The hyperbolic sine for the value.

  • tanh(arg: number): number
  • Hyperbolic tangent

    Parameters

    • arg: number

      Value.

    Returns number

    The hyperbolic tangent for the value.

  • toNumber(str: string): number
  • Convert a string to a number.

    Parameters

    • str: string

      String to convert.

    Returns number

    The parsed number, or NaN if invalid.

  • toString(num: number): string
  • Convert a number to a string.

    Parameters

    • num: number

      Value to convert to a string.

    Returns string

    The value as a string.

  • toggleVariableBoolean(variable: Variable): void
  • deprecated

    Parameters

    Returns void

  • trunc(x: number): number
  • Truncate a number.

    Parameters

    • x: number

      Value.

    Returns number

    Return the value with all decimal places dropped.

  • valuePush(array: Variable, value: string | number | boolean): void
  • deprecated

    Parameters

    • array: Variable
    • value: string | number | boolean

    Returns void

  • variableChildExists(variable: Variable, childName: string): boolean
  • deprecated

    Parameters

    Returns boolean

  • variableClearChildren(variable: Variable): void
  • deprecated

    Parameters

    Returns void

  • variableRemoveAt(array: Variable, index: number): void
  • deprecated

    Parameters

    Returns void

  • variableRemoveChild(variable: Variable, childName: string): void
  • deprecated

    Parameters

    Returns void

Generated using TypeDoc