static TextureArrayBuilder CreateArray( int width, int height, int count, ImageFormat format )

book_4_sparkGenerated
code_blocksInput

Description

The CreateArray method is a static method of the Texture class in the Sandbox API. It is used to initiate the creation of a 2D texture array. A texture array is a collection of 2D textures that share the same dimensions and format, allowing for efficient rendering and manipulation.

Usage

To use the CreateArray method, you need to provide the following parameters:

  • width (int): The width of each texture in the array, in pixels.
  • height (int): The height of each texture in the array, in pixels.
  • count (int): The number of textures in the array.
  • format (ImageFormat): The image format for the textures in the array. This determines how the texture data is stored and processed.

The method returns a TextureArrayBuilder object, which can be used to further configure and finalize the creation of the texture array.

Example

// Example of creating a texture array with 10 textures, each 256x256 pixels, in RGBA format.
var textureArrayBuilder = Texture.CreateArray(256, 256, 10, ImageFormat.RGBA8);

// Use the builder to configure and finalize the texture array as needed.