VisibilityEnabler.xml 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. <?xml version="1.0" encoding="UTF-8" ?>
  2. <class name="VisibilityEnabler" inherits="VisibilityNotifier" category="Core" version="3.0.alpha.custom_build">
  3. <brief_description>
  4. Enable certain nodes only when visible.
  5. </brief_description>
  6. <description>
  7. The VisibilityEnabler will disable [RigidBody] and [AnimationPlayer] nodes when they are not visible. It will only affect other nodes within the same scene as the VisibilityEnabler itself.
  8. </description>
  9. <tutorials>
  10. </tutorials>
  11. <demos>
  12. </demos>
  13. <methods>
  14. <method name="is_enabler_enabled" qualifiers="const">
  15. <return type="bool">
  16. </return>
  17. <argument index="0" name="enabler" type="int" enum="VisibilityEnabler.Enabler">
  18. </argument>
  19. <description>
  20. Returns whether the specified enabler was set to true or not.
  21. </description>
  22. </method>
  23. <method name="set_enabler">
  24. <return type="void">
  25. </return>
  26. <argument index="0" name="enabler" type="int" enum="VisibilityEnabler.Enabler">
  27. </argument>
  28. <argument index="1" name="enabled" type="bool">
  29. </argument>
  30. <description>
  31. Set an enabler to true for all nodes of its type to be disabled when the VisibilityEnabler is not in view. See the constants for enablers and what they affect.
  32. </description>
  33. </method>
  34. </methods>
  35. <members>
  36. <member name="freeze_bodies" type="bool" setter="set_enabler" getter="is_enabler_enabled">
  37. </member>
  38. <member name="pause_animations" type="bool" setter="set_enabler" getter="is_enabler_enabled">
  39. </member>
  40. </members>
  41. <constants>
  42. <constant name="ENABLER_PAUSE_ANIMATIONS" value="0">
  43. This enabler will pause [AnimationPlayer] nodes.
  44. </constant>
  45. <constant name="ENABLER_FREEZE_BODIES" value="1">
  46. This enabler will freeze [RigidBody] nodes.
  47. </constant>
  48. <constant name="ENABLER_MAX" value="2">
  49. </constant>
  50. </constants>
  51. </class>