Node.inBoundsImpl

Test if the specified point is the node's bounds. This is used to map screen positions to nodes, such as when determining which nodes are hovered by mouse. If the node contains the point, then it is "opaque," and if not, it is "transparent".

User-provided implementation should override inBoundsImpl; calls testing the node's bounds should use inBounds, which automatically applies the isOpaque field as a filter on the result.

This is rarely used in nodes built into Fluid. A notable example where this is overridden is Space, which is always transparent, expecting children to block occupied areas. This makes Space very handy for visually transparent overlays.

class Node
protected
inBoundsImpl
(
Rectangle outer
,
Rectangle inner
,
Vector2 position
)

Parameters

outer Rectangle

Padding box of the node.

inner Rectangle

Content box of the node.

position Vector2

Tested position.

Return Value

Type: IsOpaque

Any of the values of IsOpaque. In most cases, either IsOpaque.yes or IsOpaque.no, depending whether the node is opaque or not in the specific point. Children nodes do not contribute to a node's opaqueness.

If isOpaque is set to a non-default value, inBounds will use it as a filter, reducing the opaqueness.

Returning a value of InBounds.onlySelf can be used to hijack hover events that would otherwise be handled by the children.

See Also

isOpaque to filter the return value, making the node or its children transparent.

Meta