class_instanceplaceholder.rst 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. :github_url: hide
  2. .. Generated automatically by doc/tools/makerst.py in Godot's source tree.
  3. .. DO NOT EDIT THIS FILE, but the InstancePlaceholder.xml source instead.
  4. .. The source is found in doc/classes or modules/<name>/doc_classes.
  5. .. _class_InstancePlaceholder:
  6. InstancePlaceholder
  7. ===================
  8. **Inherits:** :ref:`Node<class_Node>` **<** :ref:`Object<class_Object>`
  9. Placeholder for the root :ref:`Node<class_Node>` of a :ref:`PackedScene<class_PackedScene>`.
  10. Description
  11. -----------
  12. Turning on the option **Load As Placeholder** for an instanced scene in the editor causes it to be replaced by an ``InstancePlaceholder`` when running the game. This makes it possible to delay actually loading the scene until calling :ref:`create_instance<class_InstancePlaceholder_method_create_instance>`. This is useful to avoid loading large scenes all at once by loading parts of it selectively.
  13. The ``InstancePlaceholder`` does not have a transform. This causes any child nodes to be positioned relatively to the :ref:`Viewport<class_Viewport>` from point (0,0), 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.
  14. Methods
  15. -------
  16. +-------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  17. | :ref:`Node<class_Node>` | :ref:`create_instance<class_InstancePlaceholder_method_create_instance>` **(** :ref:`bool<class_bool>` replace=false, :ref:`PackedScene<class_PackedScene>` custom_scene=null **)** |
  18. +-------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  19. | :ref:`String<class_String>` | :ref:`get_instance_path<class_InstancePlaceholder_method_get_instance_path>` **(** **)** const |
  20. +-------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  21. | :ref:`Dictionary<class_Dictionary>` | :ref:`get_stored_values<class_InstancePlaceholder_method_get_stored_values>` **(** :ref:`bool<class_bool>` with_order=false **)** |
  22. +-------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  23. Method Descriptions
  24. -------------------
  25. .. _class_InstancePlaceholder_method_create_instance:
  26. - :ref:`Node<class_Node>` **create_instance** **(** :ref:`bool<class_bool>` replace=false, :ref:`PackedScene<class_PackedScene>` custom_scene=null **)**
  27. ----
  28. .. _class_InstancePlaceholder_method_get_instance_path:
  29. - :ref:`String<class_String>` **get_instance_path** **(** **)** const
  30. Gets the path to the :ref:`PackedScene<class_PackedScene>` resource file that is loaded by default when calling :ref:`create_instance<class_InstancePlaceholder_method_create_instance>`.
  31. ----
  32. .. _class_InstancePlaceholder_method_get_stored_values:
  33. - :ref:`Dictionary<class_Dictionary>` **get_stored_values** **(** :ref:`bool<class_bool>` with_order=false **)**