TextureLayered

继承: Texture < Resource < RefCounted < Object

派生: CompressedTextureLayered, ImageTextureLayered, PlaceholderTextureLayered, TextureLayeredRD

Base class for texture types which contain the data of multiple Image s. Each image is of the same size and format.

描述

Base class for ImageTextureLayered and CompressedTextureLayered. Cannot be used directly, but contains all the functions necessary for accessing the derived resource types. See also Texture3D.

Data is set on a per-layer basis. For Texture2DArray s, the layer specifies the array layer.

All images need to have the same width, height and number of mipmap levels.

A TextureLayered can be loaded with ResourceLoader.load.

Internally, Godot maps these files to their respective counterparts in the target rendering driver (Vulkan, OpenGL3).

方法

Format_get_format ( ) virtual1 const2
int_get_height ( ) virtual1 const2
Image_get_layer_data ( layer_index: int ) virtual1 const2
int_get_layered_type ( ) virtual1 const2
int_get_layers ( ) virtual1 const2
int_get_width ( ) virtual1 const2
bool_has_mipmaps ( ) virtual1 const2
Formatget_format ( ) const2
intget_height ( ) const2
Imageget_layer_data ( layer: int ) const2
LayeredTypeget_layered_type ( ) const2
intget_layers ( ) const2
intget_width ( ) const2
boolhas_mipmaps ( ) const2

枚举

enum LayeredType:

LayeredType LAYERED_TYPE_2D_ARRAY = 0

Texture is a generic Texture2DArray.

LayeredType LAYERED_TYPE_CUBEMAP = 1

Texture is a Cubemap, with each side in its own layer (6 in total).

LayeredType LAYERED_TYPE_CUBEMAP_ARRAY = 2

Texture is a CubemapArray, with each cubemap being made of 6 layers.


方法说明

Format _get_format ( ) virtual1 const2

Called when the TextureLayered's format is queried.


int _get_height ( ) virtual1 const2

Called when the TextureLayered's height is queried.


Image _get_layer_data ( layer_index: int ) virtual1 const2

Called when the data for a layer in the TextureLayered is queried.


int _get_layered_type ( ) virtual1 const2

Called when the layers' type in the TextureLayered is queried.


int _get_layers ( ) virtual1 const2

Called when the number of layers in the TextureLayered is queried.


int _get_width ( ) virtual1 const2

Called when the TextureLayered's width queried.


bool _has_mipmaps ( ) virtual1 const2

Called when the presence of mipmaps in the TextureLayered is queried.


Format get_format ( ) const2

Returns the current format being used by this texture. See Format for details.


int get_height ( ) const2

Returns the height of the texture in pixels. Height is typically represented by the Y axis.


Image get_layer_data ( layer: int ) const2

Returns an Image resource with the data from specified layer.


LayeredType get_layered_type ( ) const2

Returns the TextureLayered's type. The type determines how the data is accessed, with cubemaps having special types.


int get_layers ( ) const2

Returns the number of referenced Image s.


int get_width ( ) const2

Returns the width of the texture in pixels. Width is typically represented by the X axis.


bool has_mipmaps ( ) const2

Returns true if the layers have generated mipmaps.

1

本方法通常需要用户覆盖才能生效。

2

本方法无副作用,不会修改该实例的任何成员变量。

3

本方法除了能接受在此处描述的参数外,还能够继续接受任意数量的参数。

4

本方法用于构造某个类型。

5

调用本方法无需实例,可直接使用类名进行调用。

6

本方法描述的是使用本类型作为左操作数的有效运算符。

7

这个值是由下列位标志构成位掩码的整数。

8

无返回值。