InstancePlaceholder
Marcador de posición para la raíz Node de una PackedScene.
Descripción
Turning on the option Load As Placeholder for an instantiated scene in the editor causes it to be replaced by an InstancePlaceholder when running the game, this will not replace the node in the editor. This makes it possible to delay actually loading the scene until calling create_instance(). This is useful to avoid loading large scenes all at once by loading parts of it selectively.
Note: Like Node, InstancePlaceholder does not have a transform. This causes any child nodes to be positioned relatively to the Viewport origin, rather than their parent as displayed in the editor. Replacing the placeholder with a scene with a transform will transform children relatively to their parent again.
Métodos
create_instance(replace: bool = false, custom_scene: PackedScene = null) |
|
get_instance_path() const |
|
get_stored_values(with_order: bool = false) |
Descripciones de Métodos
Node create_instance(replace: bool = false, custom_scene: PackedScene = null) 🔗
Llama a este método para cargar el nodo. El nodo creado será colocado como un hermano por encima del InstancePlaceholder en el árbol de la escena. La referencia del Node también se devuelve por conveniencia.
Nota: create_instance() no es seguro para hilos. Usa Object.call_deferred() si se llama desde un hilo.
String get_instance_path() const 🔗
Obtiene la ruta del archivo de recursos PackedScene que se carga por defecto al llamar a create_instance(). No es seguro para hilos. Usa Object.call_deferred() si se llama desde un hilo.
Dictionary get_stored_values(with_order: bool = false) 🔗
Devuelve la lista de propiedades que se aplicarán al nodo cuando se llame a create_instance().
Si with_order es true, se añade al diccionario una clave llamada .order (nótese el punto inicial). Esta clave .order es un Array de Strings que contiene los nombres de las propiedades, especificando el orden en que se aplicarán (siendo el índice 0 el primero).