Table of Contents

Class GradientTexture2D

A 2D texture that creates a pattern with colors obtained from a Gradient.

Inheritance
GradientTexture2D

Remarks

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.

Properties

fill

The gradient fill type, one of the Fill values. The texture is filled by interpolating colors starting from fill_from to fill_to offsets.

var fill : int = 0

Property Value

int

Remarks

  • void set_fill(int value)
  • int get_fill

fill_from

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

var fill_from : Vector2 = Vector2(0, 0)

Property Value

Vector2

Remarks

fill_to

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

var fill_to : Vector2 = Vector2(1, 0)

Property Value

Vector2

Remarks

gradient

The Gradient used to fill the texture.

var gradient : Gradient

Property Value

Gradient

Remarks

height

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

var height : int = 64

Property Value

int

Remarks

  • void set_height(int value)
  • int get_height

repeat

The gradient repeat type, one of the Repeat values. The texture is filled starting from fill_from to fill_to offsets by default, but the gradient fill can be repeated to cover the entire texture.

var repeat : int = 0

Property Value

int

Remarks

  • void set_repeat(int value)
  • int get_repeat

use_hdr

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

var use_hdr : bool = false

Property Value

bool

Remarks

  • void set_use_hdr(bool value)
  • bool is_using_hdr

width

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

var width : int = 64

Property Value

int

Remarks

  • void set_width(int value)
  • int get_width