Texture2DBuilder WithScreenFormat()

robot_2Generated
code_blocksInput

Description

The WithScreenFormat method is a part of the Texture2DBuilder class in the Sandbox namespace. This method configures the texture to use a format that is optimized for screen rendering. It is typically used when you want to create a texture that will be displayed directly on the screen, ensuring that the format is compatible with screen output.

Usage

To use the WithScreenFormat method, you must first create an instance of Texture2DBuilder. Then, call the WithScreenFormat method on this instance to set the texture format to a screen-optimized format. This method can be chained with other configuration methods provided by Texture2DBuilder to further customize the texture before finalizing it with the Finish method.

Example

// Example of using WithScreenFormat
Texture2DBuilder builder = new Texture2DBuilder();
Texture texture = builder
    .WithSize(1920, 1080) // Set the size of the texture
    .WithScreenFormat()   // Set the format to screen optimized
    .Finish();            // Finalize and create the texture