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. This method returns a TextureArrayBuilder
which can be used to further configure and finalize the texture array creation process.
Usage
To use the CreateArray
method, you need to specify the width and height of each texture in the array, the number of textures (count) in the array, and the image format. The method will return a TextureArrayBuilder
that allows you to configure additional properties 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.RGBA);
// Further configuration can be done using the textureArrayBuilder
// textureArrayBuilder.SetSomeProperty(...);
// Finalize the creation
var textureArray = textureArrayBuilder.Create();