Table of Contents

Class GradientTexture2D

Namespace
Godot
Assembly
GodotSharp.dll

A 2D texture that obtains colors from a Gradient to fill the texture data. This texture is able to transform a color transition into different patterns such as a linear or a radial gradient. The gradient is sampled individually for each pixel so it does not necessarily represent an exact copy of the gradient(see Width and Height). See also GradientTexture1D, CurveTexture and CurveXyzTexture.

public class GradientTexture2D : Texture2D, IDisposable
Inheritance
GradientTexture2D
Implements
Inherited Members

Constructors

GradientTexture2D()

public GradientTexture2D()

Properties

Fill

The gradient fill type, one of the GradientTexture2D.FillEnum values. The texture is filled by interpolating colors starting from FillFrom to FillTo offsets.

public GradientTexture2D.FillEnum Fill { get; set; }

Property Value

GradientTexture2D.FillEnum

FillFrom

The initial offset used to fill the texture specified in UV coordinates.

public Vector2 FillFrom { get; set; }

Property Value

Vector2

FillTo

The final offset used to fill the texture specified in UV coordinates.

public Vector2 FillTo { get; set; }

Property Value

Vector2

Gradient

The Gradient used to fill the texture.

public Gradient Gradient { get; set; }

Property Value

Gradient

Height

The number of vertical color samples that will be obtained from the Gradient, which also represents the texture's height.

public int Height { get; set; }

Property Value

int

Repeat

The gradient repeat type, one of the GradientTexture2D.RepeatEnum values. The texture is filled starting from FillFrom to FillTo offsets by default, but the gradient fill can be repeated to cover the entire texture.

public GradientTexture2D.RepeatEnum Repeat { get; set; }

Property Value

GradientTexture2D.RepeatEnum

UseHdr

If true, the generated texture will support high dynamic range (Rgbaf format). This allows for glow effects to work if GlowEnabled is true. If false, the generated texture will use low dynamic range; overbright colors will be clamped (Rgba8 format).

public bool UseHdr { get; set; }

Property Value

bool

Width

The number of horizontal color samples that will be obtained from the Gradient, which also represents the texture's width.

public int Width { get; set; }

Property Value

int

Methods

HasGodotClassMethod(in godot_string_name)

Check if the type contains a method with the given name. This method is used by Godot to check if a method exists before invoking it. Do not call or override this method.

protected override bool HasGodotClassMethod(in godot_string_name method)

Parameters

method godot_string_name

Name of the method to check for.

Returns

bool

HasGodotClassSignal(in godot_string_name)

Check if the type contains a signal with the given name. This method is used by Godot to check if a signal exists before raising it. Do not call or override this method.

protected override bool HasGodotClassSignal(in godot_string_name signal)

Parameters

signal godot_string_name

Name of the signal to check for.

Returns

bool

InvokeGodotClassMethod(in godot_string_name, NativeVariantPtrArgs, out godot_variant)

Invokes the method with the given name, using the given arguments. This method is used by Godot to invoke methods from the engine side. Do not call or override this method.

protected override bool InvokeGodotClassMethod(in godot_string_name method, NativeVariantPtrArgs args, out godot_variant ret)

Parameters

method godot_string_name

Name of the method to invoke.

args NativeVariantPtrArgs

Arguments to use with the invoked method.

ret godot_variant

Value returned by the invoked method.

Returns

bool