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.

GradientTexture1D

繼承: Texture2D < Texture < Resource < RefCounted < Object

使用從 Gradient 獲得的顏色的 1D 紋理。

說明

GradientTexture1D 使用一個 Gradient 來填充紋理資料。該漸變紋理將使用從漸變中獲得的顏色從左到右進行填充。這意味著該紋理不一定代表漸變的精確副本,而是以固定步長從漸變中獲得的樣本的插值(見 width)。另見 GradientTexture2DCurveTextureCurveXYZTexture

屬性

Gradient

gradient

bool

resource_local_to_scene

false (overrides Resource)

bool

use_hdr

false

int

width

256


屬性說明

Gradient gradient 🔗

用於填充紋理的 Gradient


bool use_hdr = false 🔗

  • void set_use_hdr(value: bool)

  • bool is_using_hdr()

如果為 true,則生成的紋理會支援高動態範圍(Image.FORMAT_RGBAF 格式)。可以在 Environment.glow_enabledtrue 時實作輝光效果。如果為 false,則生成的紋理會使用低動態範圍;過亮的顏色會被鉗制(Image.FORMAT_RGBA8 格式)。


int width = 256 🔗

  • void set_width(value: int)

  • int get_width()

將從 Gradient 中獲得的顏色樣本的數量。