Engine API Reference - v2.6.1
    Preparing search index...

    Function bytesToInt32

    • Convert 4 1-byte Numbers into a single unsigned 32bit Number.

      Parameters

      • r: number

        A single byte (0-255).

      • g: number

        A single byte (0-255).

      • b: number

        A single byte (0-255).

      • a: number

        A single byte (0-255).

      Returns number

      A single unsigned 32bit Number.

      // Set result1 to 0x11223344 from an array of 4 values
      const result1 = pc.math.bytesToInt32([0x11, 0x22, 0x33, 0x44]);

      // Set result2 to 0x11223344 from 4 discrete values
      const result2 = pc.math.bytesToInt32(0x11, 0x22, 0x33, 0x44);