2
0

class_visibleonscreennotifier2d.rst 3.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495
  1. :github_url: hide
  2. .. DO NOT EDIT THIS FILE!!!
  3. .. Generated automatically from Godot engine sources.
  4. .. Generator: https://github.com/godotengine/godot/tree/master/doc/tools/make_rst.py.
  5. .. XML source: https://github.com/godotengine/godot/tree/master/doc/classes/VisibleOnScreenNotifier2D.xml.
  6. .. _class_VisibleOnScreenNotifier2D:
  7. VisibleOnScreenNotifier2D
  8. =========================
  9. **Inherits:** :ref:`Node2D<class_Node2D>` **<** :ref:`CanvasItem<class_CanvasItem>` **<** :ref:`Node<class_Node>` **<** :ref:`Object<class_Object>`
  10. **Inherited By:** :ref:`VisibleOnScreenEnabler2D<class_VisibleOnScreenEnabler2D>`
  11. Detects when the node extents are visible on screen.
  12. Description
  13. -----------
  14. The VisibleOnScreenNotifier2D detects when it is visible on the screen. It also notifies when its bounding rectangle enters or exits the screen or a viewport.
  15. If you want nodes to be disabled automatically when they exit the screen, use :ref:`VisibleOnScreenEnabler2D<class_VisibleOnScreenEnabler2D>` instead.
  16. Tutorials
  17. ---------
  18. - `2D Dodge The Creeps Demo <https://godotengine.org/asset-library/asset/515>`__
  19. Properties
  20. ----------
  21. +---------------------------+------------------------------------------------------------+-----------------------------+
  22. | :ref:`Rect2<class_Rect2>` | :ref:`rect<class_VisibleOnScreenNotifier2D_property_rect>` | ``Rect2(-10, -10, 20, 20)`` |
  23. +---------------------------+------------------------------------------------------------+-----------------------------+
  24. Methods
  25. -------
  26. +-------------------------+----------------------------------------------------------------------------------------------+
  27. | :ref:`bool<class_bool>` | :ref:`is_on_screen<class_VisibleOnScreenNotifier2D_method_is_on_screen>` **(** **)** |const| |
  28. +-------------------------+----------------------------------------------------------------------------------------------+
  29. Signals
  30. -------
  31. .. _class_VisibleOnScreenNotifier2D_signal_screen_entered:
  32. - **screen_entered** **(** **)**
  33. Emitted when the VisibleOnScreenNotifier2D enters the screen.
  34. ----
  35. .. _class_VisibleOnScreenNotifier2D_signal_screen_exited:
  36. - **screen_exited** **(** **)**
  37. Emitted when the VisibleOnScreenNotifier2D exits the screen.
  38. Property Descriptions
  39. ---------------------
  40. .. _class_VisibleOnScreenNotifier2D_property_rect:
  41. - :ref:`Rect2<class_Rect2>` **rect**
  42. +-----------+-----------------------------+
  43. | *Default* | ``Rect2(-10, -10, 20, 20)`` |
  44. +-----------+-----------------------------+
  45. | *Setter* | set_rect(value) |
  46. +-----------+-----------------------------+
  47. | *Getter* | get_rect() |
  48. +-----------+-----------------------------+
  49. The VisibleOnScreenNotifier2D's bounding rectangle.
  50. Method Descriptions
  51. -------------------
  52. .. _class_VisibleOnScreenNotifier2D_method_is_on_screen:
  53. - :ref:`bool<class_bool>` **is_on_screen** **(** **)** |const|
  54. If ``true``, the bounding rectangle is on the screen.
  55. \ **Note:** It takes one frame for the node's visibility to be assessed once added to the scene tree, so this method will return ``false`` right after it is instantiated, even if it will be on screen in the draw pass.
  56. .. |virtual| replace:: :abbr:`virtual (This method should typically be overridden by the user to have any effect.)`
  57. .. |const| replace:: :abbr:`const (This method has no side effects. It doesn't modify any of the instance's member variables.)`
  58. .. |vararg| replace:: :abbr:`vararg (This method accepts any number of arguments after the ones described here.)`
  59. .. |constructor| replace:: :abbr:`constructor (This method is used to construct a type.)`
  60. .. |static| replace:: :abbr:`static (This method doesn't need an instance to be called, so it can be called directly using the class name.)`
  61. .. |operator| replace:: :abbr:`operator (This method describes a valid operator to use with this type as left-hand operand.)`