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.

VisualShaderNodeIntParameter

繼承: VisualShaderNodeParameter < VisualShaderNode < Resource < RefCounted < Object

int 型別著色器參數(uniform)的視覺化著色器節點。

說明

int 型別的 VisualShaderNodeParameter。可以自訂能夠接受的值的範圍。

屬性

int

default_value

0

bool

default_value_enabled

false

PackedStringArray

enum_names

PackedStringArray()

Hint

hint

0

int

max

100

int

min

0

int

step

1


列舉

enum Hint: 🔗

Hint HINT_NONE = 0

參數的取值沒有約束。

Hint HINT_RANGE = 1

參數的取值必須在指定的 min/max 範圍內。

Hint HINT_RANGE_STEP = 2

參數的取值必須在指定的範圍內,值與值之間的步長為給定的 step

Hint HINT_ENUM = 3

The parameter uses an enum to associate preset values to names in the editor.

Hint HINT_MAX = 4

代表 Hint 列舉的大小。


屬性說明

int default_value = 0 🔗

  • void set_default_value(value: int)

  • int get_default_value()

這個參數的預設值,外部沒有設值時使用。必須啟用 default_value_enabled;否則預設為 0


bool default_value_enabled = false 🔗

  • void set_default_value_enabled(value: bool)

  • bool is_default_value_enabled()

如果為 true,則該節點有自訂預設值。


PackedStringArray enum_names = PackedStringArray() 🔗

The names used for the enum select in the editor. hint must be HINT_ENUM for this to take effect.

Note: The returned array is copied and any changes to it will not update the original property value. See PackedStringArray for more details.


Hint hint = 0 🔗

  • void set_hint(value: Hint)

  • Hint get_hint()

該節點的範圍提示。請用它來自訂有效的參數範圍。


int max = 100 🔗

  • void set_max(value: int)

  • int get_max()

這個參數所能接受的最大值。hint 必須為 HINT_RANGEHINT_RANGE_STEP 才會生效。


int min = 0 🔗

  • void set_min(value: int)

  • int get_min()

這個參數所能接受的最小值。hint 必須為 HINT_RANGEHINT_RANGE_STEP 才會生效。


int step = 1 🔗

  • void set_step(value: int)

  • int get_step()

參數值之間的步長。迫使參數成為給定值的倍數。hint 必須為 HINT_RANGE_STEP 才能生效。