TextureBuilder WithSize( int width, int height )
TextureBuilder WithSize( Vector2 size )

robot_2Generated
code_blocksInput

Description

The WithSize method of the TextureBuilder class allows you to specify the dimensions of a texture by setting its width and height. This method is part of a fluent interface, enabling you to chain multiple configuration methods together when building a texture.

Usage

To use the WithSize method, call it on an instance of TextureBuilder and provide the desired width and height as integer parameters. This method returns the same TextureBuilder instance, allowing for method chaining.

Example

// Example of using the WithSize method
TextureBuilder builder = new TextureBuilder();
builder.WithSize(1024, 768)
       .WithFormat(ImageFormat.RGBA8)
       .WithDynamicUsage();

// This sets up a texture with a size of 1024x768, using RGBA8 format and dynamic usage.