copyOf

Returns new array which is a copy of the original array.


fun copyOf(newSize: Int): Vector2IArray

Returns new array which is a copy of the original array, resized to the given newSize. The copy is either truncated or padded at the end with Vector2I.ZERO values if necessary.

  • If newSize is less than the size of the original array, the copy array is truncated to the newSize.

  • If newSize is greater than the size of the original array, the extra elements in the copy array are filled with Vector2I.ZERO values.