Terrain3DTextureList

Inherits: Resource < RefCounted < Object

Description

This class contains an array of Terrain3DTexture objects in 32 slots. It is a savable resource, so you can save it to disk and use the same texture list in multiple scenes that use Terrain3D. The amount of data is small, so it can be saved as a git-friendly, text based .tres file or left within the scene file.

Properties

Array[Terrain3DTexture]

textures

[]

Methods

Terrain3DTexture

get_texture(index: int)

int

get_texture_count()

void

save()

void

set_texture(index: int, texture: Terrain3DTexture)


Signals

textures_changed()

Emitted when this list is updated due to changes in the texture slots, or the files or settings in any of the Terrain3DTextures.


Constants

MAX_TEXTURES = 32

Hard coded maximum number of textures, with IDs in the range of 0-31.


Property Descriptions

Array[Terrain3DTexture] textures = []

The array of Terrain3DTextures.


Method Descriptions

Terrain3DTexture get_texture(index: int)

Returns the Terrain3DTexture with the requested ID.


int get_texture_count()

Returns the number of texture slots used.


void save()

Saves this texture list resource to disk, if saved as an external .tres or .res resource file.


void set_texture(index: int, texture: Terrain3DTexture)

Adds a Terrain3DTexture at the specified ID slot. The texture can be null to clear the slot, or remove it if its the last in the list. If the specified slot is full, it will be swapped with the source texture ID, or will find the next available ID.