reckfellENGINE

VisibleOnScreenNotifier2D

A rectangular region of 2D space that detects whether it is visible on screen.

On this page
class VisibleOnScreenNotifier2DReckfellSharpInherits Entity2D

A rectangular region of 2D space that detects whether it is visible on screen.

VisibleOnScreenNotifier2D represents a rectangular region of 2D space. When any part of this region becomes visible on screen or in a viewport, it will emit a VisibleOnScreenNotifier2D.ScreenEntered signal, and likewise it will emit a VisibleOnScreenNotifier2D.ScreenExited signal when no part of it remains visible. If you want a node to be enabled automatically when this region is visible on screen, use VisibleOnScreenEnabler2D. Note: VisibleOnScreenNotifier2D uses the render culling code to determine whether it's visible on screen, so it won't function unless CanvasItem.Visible is set to true.

Declarations checked against C# SDK 1.0.0. Expand a name to see declarations and documentation.

Constructors1

VisibleOnScreenNotifier2DConstructor
# VisibleOnScreenNotifier2D
C#
public VisibleOnScreenNotifier2D();

Properties2

RectProperty
# Rect
C#
public Rect2 Rect { get; set; }

The VisibleOnScreenNotifier2D's bounding rectangle.

ShowRectProperty
# ShowRect
C#
public bool ShowRect { get; set; }

If true, shows the rectangle area of VisibleOnScreenNotifier2D.Rect in the editor with a translucent magenta fill. Unlike changing the visibility of the VisibleOnScreenNotifier2D, this does not affect the screen culling detection.

Methods5

GetRectRect2
# GetRect
C#
public Rect2 GetRect();
Returns Rect2
IsOnScreenbool
# IsOnScreen
C#
public bool IsOnScreen();

If true, the bounding rectangle is on the screen. Note: It takes one frame for the VisibleOnScreenNotifier2D's visibility to be determined once added to the scene tree, so this method will always return false right after it is instantiated, before the draw pass.

Returns bool
IsShowingRectbool
# IsShowingRect
C#
public bool IsShowingRect();
Returns bool
SetRectvoid
# SetRect
C#
public void SetRect(Rect2 rect);
Parameters
NameTypeDefault
rectRect2—
SetShowRectvoid
# SetShowRect
C#
public void SetShowRect(bool showRect);
Parameters
NameTypeDefault
showRectbool—

Signals and events2

ScreenEnteredEvent
# ScreenEntered
C#
public event Action ScreenEntered;

Emitted when the VisibleOnScreenNotifier2D enters the screen.

ScreenExitedEvent
# ScreenExited
C#
public event Action ScreenExited;

Emitted when the VisibleOnScreenNotifier2D exits the screen.

Reckfell Engine documentationBack to top ↑
QUICK LINKSGetting startedEntity hierarchyC# & .NET 10Scenes and prefabs
Reckfell guides and full API K
reckfellENGINE
RECKFELL ACCOUNT

Sign in

Sign in to your Reckfell account.

One account for the entire Reckfell platform.