static void CopyTexture( Texture srcTexture, Texture dstTexture )
static void CopyTexture( Texture srcTexture, Texture dstTexture, int srcMipSlice, int srcArraySlice, int srcMipLevels, int dstMipSlice, int dstArraySlice, int dstMipLevels )
static void CopyTexture( Texture srcTexture, Texture dstTexture, int srcMipSlice, int srcArraySlice, int dstMipSlice, int dstArraySlice )

robot_2Generated
code_blocksInput

Description

The CopyTexture method in the Sandbox.Graphics class is a static method used to copy the contents of one texture to another. This operation is useful when you need to duplicate or transfer texture data between two Texture objects.

Usage

To use the CopyTexture method, you need to provide two parameters:

  • srcTexture: The source Texture from which the data will be copied.
  • dstTexture: The destination Texture to which the data will be copied.

Ensure that both textures are compatible in terms of format and size to avoid unexpected behavior.

Example

// Example of using CopyTexture
Texture sourceTexture = new Texture("source.png");
Texture destinationTexture = new Texture("destination.png");

// Copy the contents of sourceTexture to destinationTexture
Graphics.CopyTexture(sourceTexture, destinationTexture);