Description
The Create
method is a static method of the Texture
class in the Sandbox namespace. It is used to initiate the creation of a 2D texture with specified dimensions and image format. This method returns a Texture2DBuilder
object, which can be used to further configure and finalize the texture creation process.
Usage
To use the Create
method, you need to provide the width and height of the texture in pixels, as well as the desired image format. The method will return a Texture2DBuilder
that allows you to set additional properties and finalize the texture creation.
Example
// Example of creating a 2D texture with specific dimensions and format
int width = 256;
int height = 256;
ImageFormat format = ImageFormat.RGBA8;
Texture2DBuilder textureBuilder = Texture.Create(width, height, format);
// Further configuration can be done using the textureBuilder
// For example, setting texture data, mipmaps, etc.
// textureBuilder.SetData(...);
// textureBuilder.Create();