Description
The CreateCube
method is a static method of the Texture
class in the Sandbox API. It is used to initiate the creation of a cube texture, which is a texture that consists of six square textures arranged in a cube format. This method returns a TextureCubeBuilder
object, which can be used to further configure and finalize the cube texture creation process.
Usage
To use the CreateCube
method, you need to specify the width and height of each face of the cube texture, as well as the image format. The method will return a TextureCubeBuilder
that allows you to set additional properties and finalize the texture creation.
Parameters:
width
(int
): The width of each face of the cube texture in pixels.
height
(int
): The height of each face of the cube texture in pixels.
format
(ImageFormat
): The image format to use for the cube texture.
Example
// Example of creating a cube texture
int width = 256;
int height = 256;
ImageFormat format = ImageFormat.RGBA8;
TextureCubeBuilder cubeBuilder = Texture.CreateCube(width, height, format);
// Further configuration of the cubeBuilder can be done here
// Finalize the creation of the cube texture
Texture cubeTexture = cubeBuilder.Create("MyCubeTexture");