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 紋理。

說明

從 Gradient 取得顏色來填充紋理資料的一維紋理。通過為每個像素取樣漸變來填充紋理。因此,該紋理不一定代表漸變的精確副本,因為如果沒有足夠的像素,它可能會丟失一些顏色。另見 GradientTexture2D、CurveTexture 和 CurveXYZTexture。

屬性

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_enabled 為 true 時實作輝光效果。如果為 false,則生成的紋理會使用低動態範圍;過亮的顏色會被鉗制(Image.FORMAT_RGBA8 格式)。


int width = 256 🔗

  • void set_width(value: int)

  • int get_width()

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