TextureArrayBuilder WithData( System.Byte[] data, int dataLength )

book_4_sparkGenerated
code_blocksInput

Description

The WithData method of the TextureArrayBuilder class allows you to specify the raw byte data for a texture array. This method is part of a fluent interface, enabling you to chain multiple configuration methods together to build a texture array.

Usage

To use the WithData method, you need to provide a byte array that contains the texture data. This method returns the TextureArrayBuilder instance, allowing for method chaining.

Example

// Example of using WithData method
byte[] textureData = LoadTextureData(); // Assume this method loads your texture data
TextureArrayBuilder builder = new TextureArrayBuilder();
builder.WithData(textureData)
       .WithSize(256, 256) // Example of chaining with other configuration methods
       .WithFormat(ImageFormat.RGBA8);

Texture textureArray = builder.Finish(); // Finalize and create the texture array