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.
Checking the stable version of the documentation...
InstancePlaceholder
Segnaposto per il Node radice di un PackedScene.
Descrizione
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.
Metodi
create_instance(replace: bool = false, custom_scene: PackedScene = null) |
|
get_instance_path() const |
|
get_stored_values(with_order: bool = false) |
Descrizioni dei metodi
Node create_instance(replace: bool = false, custom_scene: PackedScene = null) 🔗
Chiama questo metodo per caricare effettivamente il nodo. Il nodo creato verrà posizionato come fratello sopra l'InstancePlaceholder nell'albero di scene. Per comodità, viene restituito anche il riferimento al Node creato.
Nota: create_instance() non è sicuro su un altro thread. Usa Object.call_deferred() se si chiama da un thread.
String get_instance_path() const 🔗
Ottiene il percorso al file della risorsa PackedScene caricata come predefinita quando si chiama create_instance(). Non è sicuro su un altro thread. Utilizza Object.call_deferred() se si chiama da un thread.
Dictionary get_stored_values(with_order: bool = false) 🔗
Restituisce la lista delle proprietà che saranno applicate al nodo quando create_instance() è chiamato.
Se with_order è true, una chiave denominata .order (nota il punto iniziale) viene aggiunta al dizionario. Questa chiave .order è un Array di nomi di proprietà String che specificano l'ordine in cui le proprietà saranno applicate (con l'indice 0 come primo).