InstancePlaceholder.xml 2.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. <?xml version="1.0" encoding="UTF-8" ?>
  2. <class name="InstancePlaceholder" inherits="Node" category="Core" version="3.0.alpha.custom_build">
  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 instanced scene in the editor causes it to be replaced by an InstacePlaceholder when running the game. This makes it possible to delay actually loading the scene until calling [method replace_by_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. <demos>
  13. </demos>
  14. <methods>
  15. <method name="get_instance_path" qualifiers="const">
  16. <return type="String">
  17. </return>
  18. <description>
  19. Retrieve the path to the [PackedScene] resource file that is loaded by default when calling [method replace_by_instance].
  20. </description>
  21. </method>
  22. <method name="get_stored_values">
  23. <return type="Dictionary">
  24. </return>
  25. <argument index="0" name="with_order" type="bool" default="false">
  26. </argument>
  27. <description>
  28. </description>
  29. </method>
  30. <method name="replace_by_instance">
  31. <return type="void">
  32. </return>
  33. <argument index="0" name="custom_scene" type="PackedScene" default="null">
  34. </argument>
  35. <description>
  36. Replace this placeholder by the scene handed as an argument, or the original scene if no argument is given. As for all resources, the scene is loaded only if it's not loaded already. By manually loading the scene beforehand, delays caused by this function can be avoided.
  37. </description>
  38. </method>
  39. </methods>
  40. <constants>
  41. </constants>
  42. </class>