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 ( )

Emitted when the VisibilityNotifier2D enters the screen.

  • enter_viewport ( Object viewport )

Emitted when the VisibilityNotifier2D enters a Viewport.

  • exit_screen ( )

Emitted when the VisibilityNotifier2D exits the screen.

  • exit_viewport ( Object viewport )

Emitted when the VisibilityNotifier2D exits a 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.