MeshLibrary

Inherits: Resource < Reference < Object

Biblioteca de mallas.

Descripción

Una biblioteca de mallas. Contiene una lista de recursos de Mesh, cada uno con un nombre y una identificación. Cada elemento también puede incluir formas de colisión y de navegación. Este recurso se utiliza en GridMap.

Tutoriales

Métodos

void

clear ( )

void

create_item ( int id )

int

find_item_by_name ( String name ) const

PoolIntArray

get_item_list ( ) const

Mesh

get_item_mesh ( int id ) const

Transform

get_item_mesh_transform ( int id ) const

String

get_item_name ( int id ) const

NavigationMesh

get_item_navmesh ( int id ) const

Transform

get_item_navmesh_transform ( int id ) const

Texture

get_item_preview ( int id ) const

Array

get_item_shapes ( int id ) const

int

get_last_unused_item_id ( ) const

void

remove_item ( int id )

void

set_item_mesh ( int id, Mesh mesh )

void

set_item_mesh_transform ( int id, Transform mesh_transform )

void

set_item_name ( int id, String name )

void

set_item_navmesh ( int id, NavigationMesh navmesh )

void

set_item_navmesh_transform ( int id, Transform navmesh )

void

set_item_preview ( int id, Texture texture )

void

set_item_shapes ( int id, Array shapes )

Descripciones de Métodos

  • void clear ( )

Limpia la biblioteca.


  • void create_item ( int id )

Crea un nuevo artículo en la biblioteca con la identificación dada.

Puedes obtener un ID sin usar con el get_last_unused_item_id.


  • int find_item_by_name ( String name ) const

Devuelve el primer objeto con el nombre dado.


Devuelve la lista de ids de objetos en uso.


  • Mesh get_item_mesh ( int id ) const

Devuelve la malla del objeto.


Returns the transform applied to the item's mesh.


Devuelve el nombre del artículo.


Devuelve la malla de navegación del objeto.


Devuelve la transformada aplicada a la malla de navegación del objeto.


When running in the editor, returns a generated item preview (a 3D rendering in isometric perspective). When used in a running project, returns the manually-defined item preview which can be set using set_item_preview. Returns an empty Texture if no preview was manually set in a running project.


  • Array get_item_shapes ( int id ) const

Returns an item's collision shapes.

The array consists of each Shape followed by its Transform.


  • int get_last_unused_item_id ( ) const

Obtiene un id sin usar para un nuevo objeto.


  • void remove_item ( int id )

Quita el objeto.


  • void set_item_mesh ( int id, Mesh mesh )

Establece la malla del objeto.


  • void set_item_mesh_transform ( int id, Transform mesh_transform )

Sets the transform to apply to the item's mesh.


Establece el nombre del artículo.

Este nombre se muestra en el editor. También puede ser usado para buscar el ítem más tarde usando find_item_by_name.


Establece la malla de navegación del objeto.


  • void set_item_navmesh_transform ( int id, Transform navmesh )

Establece la transformada para aplicarla a la malla de navegación del objeto.


  • void set_item_preview ( int id, Texture texture )

Establece una textura para usar como el icono de vista previa del objeto en el editor.


  • void set_item_shapes ( int id, Array shapes )

Sets an item's collision shapes.

The array should consist of Shape objects, each followed by a Transform that will be applied to it. For shapes that should not have a transform, use Transform.IDENTITY.