The Finish
method of the Texture2DBuilder
class is used to finalize the building process and create the actual texture. This method returns a Texture
object that represents the texture constructed using the builder pattern.
The Finish
method of the Texture2DBuilder
class is used to finalize the building process and create the actual texture. This method returns a Texture
object that represents the texture constructed using the builder pattern.
To use the Finish
method, first configure the Texture2DBuilder
with the desired properties such as size, format, and data. Once all configurations are set, call the Finish
method to generate the texture.
// Example of using Texture2DBuilder to create a texture Texture2DBuilder builder = new Texture2DBuilder(); Texture texture = builder .WithSize(256, 256) .WithFormat(ImageFormat.RGBA8) .WithData(new byte[] { /* pixel data */ }) .Finish(); // Use the texture in your application // e.g., apply it to a material or render it in a scene