Class reference

GradientTexture2D

Inherits Texture2D

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

Description

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 texture is filled by interpolating colors starting from fill_from to fill_to offsets by default, but the gradient fill can be repeated to cover the entire texture. 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

int fill = 0

The gradient's fill type.

Vector2 fill_from = Vector2(0, 0)

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

Vector2 fill_to = Vector2(1, 0)

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

int height = 64

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

int repeat = 0

The gradient's repeat type.

bool resource_local_to_scene = false

int width = 64

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

Constants

FILL_LINEAR = 0

Enum: Fill

The colors are linearly interpolated in a straight line.

FILL_RADIAL = 1

Enum: Fill

The colors are linearly interpolated in a circular pattern.

FILL_SQUARE = 2

Enum: Fill

The colors are linearly interpolated in a square pattern.

REPEAT_NONE = 0

Enum: Repeat

The gradient fill is restricted to the range defined by fill_from to fill_to offsets.

REPEAT = 1

Enum: Repeat

The texture is filled starting from fill_from to fill_to offsets, repeating the same pattern in both directions.

REPEAT_MIRROR = 2

Enum: Repeat

The texture is filled starting from fill_from to fill_to offsets, mirroring the pattern in both directions.

Source revision 5592dc3a7a61
Connection interrupted. Reload×

Rejoining the server...

Rejoin failed... trying again in seconds.

Failed to rejoin.
Please retry or reload the page.

The session has been paused by the server.

Failed to resume the session.
Please retry or reload the page.