Attention: Here be dragons
This is the latest
(unstable) version of this documentation, which may document features
not available in or compatible with released stable versions of Godot.
Checking the stable version of the documentation...
GradientTexture2D
繼承: Texture2D < Texture < Resource < RefCounted < Object
將從 Gradient 中獲得的顏色樣本的數量。
說明
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.
屬性
|
||
|
||
|
||
|
||
|
||
resource_local_to_scene |
|
|
|
||
|
列舉
enum Fill: 🔗
Fill FILL_LINEAR = 0
顏色按照直線進行線性插值。
Fill FILL_RADIAL = 1
顏色按照圓形模式進行線性插值。
Fill FILL_SQUARE = 2
顏色按照方形模式進行線性插值。
Fill FILL_CONIC = 3
The colors are linearly interpolated in a cone pattern.
enum Repeat: 🔗
Repeat REPEAT_NONE = 0
漸變填充限制在由 fill_from 到 fill_to 的偏移量範圍內。
Repeat REPEAT = 1
紋理的填充從偏移量 fill_from 開始到 fill_to,兩個方向都按照相同的模式重複。
Repeat REPEAT_MIRROR = 2
屬性說明
The gradient's fill type.
Vector2 fill_from = Vector2(0, 0) 🔗
用於填充紋理的初始偏移量,使用 UV 座標。
Vector2 fill_to = Vector2(1, 0) 🔗
用於填充紋理的結束偏移量,使用 UV 座標。
用於填充紋理的 Gradient。
從 Gradient 上獲取的垂直顏色取樣數,也表示紋理的高度。
The gradient's repeat type.
如果為 true,則生成的紋理會支援高動態範圍(Image.FORMAT_RGBAF 格式)。可以在 Environment.glow_enabled 為 true 時實作輝光效果。如果為 false,則生成的紋理會使用低動態範圍;過亮的顏色會被鉗制(Image.FORMAT_RGBA8 格式)。
從 Gradient 上獲取的水平顏色取樣數,也表示紋理的寬度。