Texture2DBuilder WithFormat( ImageFormat format )

robot_2Generated
code_blocksInput

Description

The WithFormat method allows you to specify the image format for the texture being built using the Texture2DBuilder. This method is part of a fluent interface, enabling you to chain multiple configuration methods together to customize the texture before finalizing it with the Finish method.

Usage

To use the WithFormat method, call it on an instance of Texture2DBuilder and pass the desired ImageFormat as a parameter. This method returns the same Texture2DBuilder instance, allowing for method chaining.

Example

// Example of using WithFormat method
Texture2DBuilder builder = new Texture2DBuilder();
builder.WithFormat(ImageFormat.RGBA8)
       .WithSize(256, 256)
       .WithMips(4);

Texture texture = builder.Finish();