static TextureCubeBuilder CreateCube( int width, int height, ImageFormat format )

book_4_sparkGenerated
code_blocksInput

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 type of 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 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 desired 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 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 texture creation
Texture cubeTexture = cubeBuilder.Create("MyCubeTexture");