VisibilityNotifier2D.xml 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. <?xml version="1.0" encoding="UTF-8" ?>
  2. <class name="VisibilityNotifier2D" inherits="Node2D" category="Core" version="3.1.2">
  3. <brief_description>
  4. Detects when the node is visible on screen.
  5. </brief_description>
  6. <description>
  7. The VisibilityNotifier2D detects when it is visible on the screen. It also notifies when its bounding rectangle enters or exits the screen or a viewport.
  8. </description>
  9. <tutorials>
  10. </tutorials>
  11. <methods>
  12. <method name="is_on_screen" qualifiers="const">
  13. <return type="bool">
  14. </return>
  15. <description>
  16. If [code]true[/code], the bounding rectangle is on the screen.
  17. Note: It takes one frame for the node's visibility to be assessed once added to the scene tree, so this method will return [code]false[/code] right after it is instantiated, even if it will be on screen in the draw pass.
  18. </description>
  19. </method>
  20. </methods>
  21. <members>
  22. <member name="rect" type="Rect2" setter="set_rect" getter="get_rect">
  23. The VisibilityNotifier2D's bounding rectangle.
  24. </member>
  25. </members>
  26. <signals>
  27. <signal name="screen_entered">
  28. <description>
  29. Emitted when the VisibilityNotifier2D enters the screen.
  30. </description>
  31. </signal>
  32. <signal name="screen_exited">
  33. <description>
  34. Emitted when the VisibilityNotifier2D exits the screen.
  35. </description>
  36. </signal>
  37. <signal name="viewport_entered">
  38. <argument index="0" name="viewport" type="Viewport">
  39. </argument>
  40. <description>
  41. Emitted when the VisibilityNotifier2D enters a [Viewport]'s view.
  42. </description>
  43. </signal>
  44. <signal name="viewport_exited">
  45. <argument index="0" name="viewport" type="Viewport">
  46. </argument>
  47. <description>
  48. Emitted when the VisibilityNotifier2D exits a [Viewport]'s view.
  49. </description>
  50. </signal>
  51. </signals>
  52. <constants>
  53. </constants>
  54. </class>