VisibilityNotifier2D

Inherits: Node2D < CanvasItem < Node < Object

Inherited By: VisibilityEnabler2D

Category: Core

Brief Description

Detect when the node is visible on screen.

Member Functions

Rect2 get_rect ( ) const
bool is_on_screen ( ) const
void set_rect ( Rect2 rect )

Signals

  • enter_screen ( )
  • enter_viewport ( Object viewport )
  • exit_screen ( )
  • exit_viewport ( Object viewport )

Description

The VisibilityNotifier2D is used to notify when its bounding rectangle enters the screen, is visible on the screen, or when it exits the screen.

Member Function Description

  • Rect2 get_rect ( ) const

Return the visibility bounding rectangle of the VisibilityNotifier2D.

  • bool is_on_screen ( ) const

Return true if any part of the bounding rectangle is on the screen.

  • void set_rect ( Rect2 rect )

Set the visibility bounding rectangle of the VisibilityNotifier2D.