Class Range

The Range class represents a one-dimensional range, going from some start value to some end value.

Within the rest of the shimi architecture, this is most often used as a way to represent some range of time.

Hierarchy

Constructors

Accessors

Methods

Constructors

  • Parameters

    • start: number

      The value which the range starts at.

    • duration: number

      The duration of the range.

    Returns Range

Accessors

  • get duration(): number
  • The difference between the start and end values.

    Attempts to set this to a negative value will result in an error being thrown.

    Returns number

  • set duration(value: number): void
  • Parameters

    • value: number

    Returns void

  • get end(): number
  • The value which the range ends at.

    Attempts to set this to a value less than start will result in an error being thrown.

    Returns number

  • set end(value: number): void
  • Parameters

    • value: number

    Returns void

  • get start(): number
  • The value which the range starts at.

    Attempts to set this to a value greater than end will result in an error being thrown.

    Returns number

  • set start(value: number): void
  • Parameters

    • value: number

    Returns void

Methods

  • Returns true if the passed in point is greater than or equal to range start, and less than or equal to range end.

    Returns

    Parameters

    • point: number

      The point value to determine whether it's within the range.

    Returns boolean

  • Accepts a value and returns what percentage of the way into the range that the value is.

    The returned value can be negative, or greater than 100%, if the passed in value is less than the range start, or greater than the range end.

    Returns

    Parameters

    • value: number

      The value to compare against the range.

    Returns number

Generated using TypeDoc