Documentation

Unity Engine


User Manual

Script Reference

Unity Engine


GenerateTexture

Generates Texture2D and Sprite Assets based on the settings provided.
Read time 3 minutesLast updated 16 days ago

Definition

GenerateTexture(TextureGenerationSettings, NativeArray<Color32>)

Generates Texture2D and Sprite Assets based on the settings provided.
public static TextureGenerationOutput GenerateTexture(TextureGenerationSettings settings, NativeArray<Color32> colorBuffer)

Parameters

Settings use for generating Texture2D and Sprite.

Color buffer for generating Texture2D and Sprite.

Returns

Type

Description

TextureGenerationOutputResult of the generation.

Remarks

As Unity may perform in-place processing of
colorBuffer
, it is recommended that you make a copy of its original data if you need it after this method returns.
The
System.Span<T>
overloads accept any writable contiguous block of memory, such as a managed array or a NativeArray.

GenerateTexture(TextureGenerationSettings, NativeArray<Color>)

Generates Texture2D and Sprite Assets based on the settings provided.
public static TextureGenerationOutput GenerateTexture(TextureGenerationSettings settings, NativeArray<Color> colorBuffer)

Parameters

Settings use for generating Texture2D and Sprite.

Color buffer for generating Texture2D and Sprite.

Returns

Type

Description

TextureGenerationOutputResult of the generation.

Remarks

As Unity may perform in-place processing of
colorBuffer
, it is recommended that you make a copy of its original data if you need it after this method returns.
The
System.Span<T>
overloads accept any writable contiguous block of memory, such as a managed array or a NativeArray.

GenerateTexture(TextureGenerationSettings, Span<Color32>)

Generates Texture2D and Sprite Assets based on the settings provided.
public static TextureGenerationOutput GenerateTexture(TextureGenerationSettings settings, Span<Color32> colorBuffer)

Parameters

Settings use for generating Texture2D and Sprite.

colorBuffer

Color buffer for generating Texture2D and Sprite.

Returns

Type

Description

TextureGenerationOutputResult of the generation.

Remarks

As Unity may perform in-place processing of
colorBuffer
, it is recommended that you make a copy of its original data if you need it after this method returns.
The
System.Span<T>
overloads accept any writable contiguous block of memory, such as a managed array or a NativeArray.

GenerateTexture(TextureGenerationSettings, Span<Color>)

Generates Texture2D and Sprite Assets based on the settings provided.
public static TextureGenerationOutput GenerateTexture(TextureGenerationSettings settings, Span<Color> colorBuffer)

Parameters

Settings use for generating Texture2D and Sprite.

colorBuffer

Color buffer for generating Texture2D and Sprite.

Returns

Type

Description

TextureGenerationOutputResult of the generation.

Remarks

As Unity may perform in-place processing of
colorBuffer
, it is recommended that you make a copy of its original data if you need it after this method returns.
The
System.Span<T>
overloads accept any writable contiguous block of memory, such as a managed array or a NativeArray.