focusAbove

Find and focus a focusable node based on its visual position; above, below, to the left or to the right of a chosen node.

Using this function requires knowing the last position of the node, which isn't usually stored. Depending on the usecase, you may need to use FindFocusBoxAction earlier.

Nodes are chosen based on semantical weight — nodes within the same container will be prioritized over nodes in another. Only if the weight is the same, they will be compared based on their visual distance.

Parameters

node Node

Node to use as reference.

focusBox Rectangle

Last known focusBox of the node.

Return Value

A tree action which will run during the next frame. You can attach a callback using its then method to process the found node.

Meta