Capítulo 470 de 859

Chapter 470: ScreenNode

Core Idea

This node provides a collection of screen related metrics. Depending on ScreenNode#scope, the nodes can represent resolution or viewport data as well as fragment or uv coordinates.

Key Concepts

  • isViewportNode : boolean (readonly): This flag can be used for type testing.
  • scope : 'coordinate' | 'viewport' | 'size' | 'uv' | 'dpr': The node represents different metric depending on which scope is selected.

Reference Tables

Constructor

Signature
`new ScreenNode( scope : 'coordinate'

Properties

PropertyDescription
.isViewportNode : boolean (readonly)This flag can be used for type testing.
`.scope : 'coordinate''viewport'

Methods

MethodDescription
`.generateNodeType() : 'float''vec2'
.getUpdateType() : NodeUpdateTypeThis method is overwritten since the node's update type depends on the selected scope.
.update( frame : NodeFrame )ScreenNode implements Node#update to retrieve viewport and size information from the current renderer.

Key Takeaways

  1. ScreenNode extends: EventDispatcher → Node
  2. Most relevant properties: isViewportNode, scope.
  3. Key methods: generateNodeType, getUpdateType, update.

Connects To