Skip to main content

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​

DataDescription
WidthThe width of the viewport in pixels.
HeightThe height of the viewport in pixels.

Events​

SignalDescription
ChangedTriggered when the resolution changes (resize).

Usage​

Responsive Layout​

  1. Connect Width to an If node.
  2. Check if .
  3. If True -> Show "Mobile Menu".
  4. If False -> Show "Desktop Menu".

Game Canvas​

  1. 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.