Screen Resolution
This node provides the current viewport dimensions.
The Screen Resolution node outputs the width and height of the application window.
The Screen Resolution node is useful for responsive layouts. It updates whenever the browser window is resized.
Inputs
This node has no inputs.
Outputs
Dimensions
| Data | Description |
|---|---|
| Width | The width of the viewport in pixels. |
| Height | The height of the viewport in pixels. |
Events
| Signal | Description |
|---|---|
| Changed | Triggered when the resolution changes (resize). |
Usage
Responsive Layout
- Connect Width to an If node.
- Check if .
- If True -> Show "Mobile Menu".
- If False -> Show "Desktop Menu".
Game Canvas
- Connect Width and Height to the Pixi Stage dimensions to ensure the game fills the screen.
Detailed Behavior
- Debounce: Resize events might be debounced slightly to prevent flooding signals during drag.
Troubleshooting
- Mobile: On mobile, the height might change when the address bar shows/hides.