screen_notifier2d component
A box that announces screen_enter as it comes on screen and screen_exit as it leaves; offset and size place it around the node. A hidden node is off…
На тази страница
2d · render · 2 properties · 2D
A box that announces screen_enter as it comes on screen and screen_exit as it leaves; offset and size place it around the node. A hidden node is off screen.
In a scene, screen_notifier2d is the node key that applies it. A script reaches each property below as a field on node.screen_notifier2d: reading one asks the running component, and assigning one leaves the rest alone. The whole table is node.screen_notifier2d.get() and node.screen_notifier2d.set(table).
Properties
| property | type | default | description |
|---|---|---|---|
offset |
vec2 | [-0.5,-0.5] |
The box's lower corner from the node, in the node's own units: scaled and turned with it |
size |
vec2 | [1,1] |
The box's width and height, in the node's own units: scaled and turned with it |
Script functions
Methods of node.screen_notifier2d, the handle a node carrying this component exposes. Every handle also has get(), set(table), patch(table), has() and remove().
From render:
| method | what it does |
|---|---|
is_on_screen() -> bool |
Whether any of the notifier's box was on screen at the end of the last frame. |