/
VisibilityNotifier2D.hx
73 lines (60 loc) · 2.95 KB
/
VisibilityNotifier2D.hx
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
// Automatically generated Godot externs: DO NOT EDIT
// MIT licensed, see LICENSE.md
package godot;
import cs.system.*;
/**
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.
If you want nodes to be disabled automatically when they exit the screen, use `godot.VisibilityEnabler2D` instead.
Note: For performance reasons, VisibilityNotifier2D uses an approximate heuristic with precision determined by . If you need precise visibility checking, use another method such as adding an `godot.Area2D` node as a child of a `godot.Camera2D` node.
**/
@:libType
@:csNative
@:native("Godot.VisibilityNotifier2D")
@:autoBuild(godot.Godot.buildUserClass())
extern class VisibilityNotifier2D extends godot.Node2D {
/**
`screen_entered` signal.
**/
public var onScreenEntered(get, never):Signal<Void->Void>;
@:dox(hide) @:noCompletion inline function get_onScreenEntered():Signal<Void->Void> {
return new Signal(this, "screen_entered", Signal.SignalHandlerVoidVoid.connectSignal, Signal.SignalHandlerVoidVoid.disconnectSignal, Signal.SignalHandlerVoidVoid.isSignalConnected);
}
/**
`screen_exited` signal.
**/
public var onScreenExited(get, never):Signal<Void->Void>;
@:dox(hide) @:noCompletion inline function get_onScreenExited():Signal<Void->Void> {
return new Signal(this, "screen_exited", Signal.SignalHandlerVoidVoid.connectSignal, Signal.SignalHandlerVoidVoid.disconnectSignal, Signal.SignalHandlerVoidVoid.isSignalConnected);
}
/**
`viewport_entered` signal.
**/
public var onViewportEntered(get, never):Signal<(viewport:Viewport)->Void>;
@:dox(hide) @:noCompletion inline function get_onViewportEntered():Signal<(viewport:Viewport)->Void> {
return new Signal(this, "viewport_entered", Signal.SignalHandlerViewportVoid.connectSignal, Signal.SignalHandlerViewportVoid.disconnectSignal, Signal.SignalHandlerViewportVoid.isSignalConnected);
}
/**
`viewport_exited` signal.
**/
public var onViewportExited(get, never):Signal<(viewport:Viewport)->Void>;
@:dox(hide) @:noCompletion inline function get_onViewportExited():Signal<(viewport:Viewport)->Void> {
return new Signal(this, "viewport_exited", Signal.SignalHandlerViewportVoid.connectSignal, Signal.SignalHandlerViewportVoid.disconnectSignal, Signal.SignalHandlerViewportVoid.isSignalConnected);
}
/**
The VisibilityNotifier2D's bounding rectangle.
**/
@:native("Rect")
public var rect:godot.Rect2;
@:native("new")
public function new():Void;
@:native("SetRect")
public function setRect(rect:godot.Rect2):Void;
@:native("GetRect")
public function getRect():godot.Rect2;
/**
If `true`, the bounding rectangle is on the screen.
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.
**/
@:native("IsOnScreen")
public function isOnScreen():Bool;
}