InstancePlaceholder.xml 1.8 KB

12345678910111213141516171819202122232425262728293031323334
  1. <?xml version="1.0" encoding="UTF-8" ?>
  2. <class name="InstancePlaceholder" inherits="Node" version="4.0">
  3. <brief_description>
  4. Placeholder for the root [Node] of a [PackedScene].
  5. </brief_description>
  6. <description>
  7. Turning on the option [b]Load As Placeholder[/b] for an instantiated 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 [method create_instance]. This is useful to avoid loading large scenes all at once by loading parts of it selectively.
  8. The [InstancePlaceholder] does not have a transform. This causes any child nodes to be positioned relatively to the [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.
  9. </description>
  10. <tutorials>
  11. </tutorials>
  12. <methods>
  13. <method name="create_instance">
  14. <return type="Node" />
  15. <argument index="0" name="replace" type="bool" default="false" />
  16. <argument index="1" name="custom_scene" type="PackedScene" default="null" />
  17. <description>
  18. Not thread-safe. Use [method Object.call_deferred] if calling from a thread.
  19. </description>
  20. </method>
  21. <method name="get_instance_path" qualifiers="const">
  22. <return type="String" />
  23. <description>
  24. Gets the path to the [PackedScene] resource file that is loaded by default when calling [method create_instance]. Not thread-safe. Use [method Object.call_deferred] if calling from a thread.
  25. </description>
  26. </method>
  27. <method name="get_stored_values">
  28. <return type="Dictionary" />
  29. <argument index="0" name="with_order" type="bool" default="false" />
  30. <description>
  31. </description>
  32. </method>
  33. </methods>
  34. </class>