melonJS
    Preparing search index...

    Function position

    Get or set the 3D spatial position of a sound.

    Call with just sound_name to read back the group's current position; call with x (and optionally y / z / id) to write it. Missing y / z default to 0 and -0.5 respectively.

    Audio clip name (case-sensitive).

    X-coordinate of the audio source. Omit to read.

    Y-coordinate. Defaults to 0 when setting.

    Z-coordinate. Defaults to -0.5 when setting.

    Sound instance ID. When omitted, all sounds in the group are affected.

    The current [x, y, z] when called as a getter; nothing when called as a setter.

    • Parameters

      • sound_name: string

      Returns [number, number, number]

    • Parameters

      • sound_name: string
      • x: number
      • Optionaly: number
      • Optionalz: number
      • Optionalid: number

      Returns void