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.

PlaceholderTextureLayered

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

被繼承: PlaceholderCubemap, PlaceholderCubemapArray, PlaceholderTexture2DArray

二維紋理陣列的占位元類。

說明

載入使用 TextureLayered 子類別的專案時,使用這個類的情況有兩種:

  • 運作使用專用伺服器模式匯出的專案,僅保留紋理的尺寸(因為遊戲邏輯可能依賴紋理的尺寸,可能用來定位其他元素)。這樣能夠顯著減小匯出的 PCK 的大小。

  • 由於引擎版本或建構不同而缺失這個子類別(例如禁用了某些模組)。

注意:設計這個類的目的並不是作為算繪的實際紋理。不保證能夠在著色器和材質中正常工作(例如對 UV 進行計算)。

屬性

int

layers

1

Vector2i

size

Vector2i(1, 1)


屬性說明

int layers = 1 🔗

  • void set_layers(value: int)

  • int get_layers()

紋理陣列中的層數。


Vector2i size = Vector2i(1, 1) 🔗

各層紋理的尺寸(單位為圖元)。