Skip to content

NodeLayoutConstraint

Overview

Supertype for LayoutConstraints that are based on an actual Node where the layout takes place. Generally used with layout containers that are subtypes of LayoutNode.

@author Jonathan Olson <jonathan.olson@colorado.edu>

Class NodeLayoutConstraint

import { NodeLayoutConstraint } from 'scenerystack/scenery';

Instance Methods

filterLayoutCells( cells : Cell[] ) : Cell[]

(protected)

Filters out cells to only those that will be involved in layout

dispose()

Releases references

Instance Properties

preferredHeightProperty : TProperty<number | null>

(readonly)

minimumWidthProperty : TProperty<number | null>

(readonly)

minimumHeightProperty : TProperty<number | null>

(readonly)

layoutOriginProperty : TProperty<Vector2>

(readonly)

Type NodeLayoutAvailableConstraintOptions

Type export designed for use with clients

import type { NodeLayoutAvailableConstraintOptions } from 'scenerystack/scenery';

Pick<NodeLayoutConstraintOptions, "excludeInvisible" | "layoutOriginProperty">

Type NodeLayoutConstraintOptions

import type { NodeLayoutConstraintOptions } from 'scenerystack/scenery';
  • excludeInvisible?: boolean
    Whether invisible Nodes are excluded from the layout.
  • preferredWidthProperty?: TProperty<number | null>
    If available, the local versions of these Properties for the layout container should be passed in. We do the layout in the local coordinate frame of e.g. GridBox/FlowBox. It's named this way just for ease-of-use within this code.
  • preferredHeightProperty?: TProperty<number | null>
  • minimumWidthProperty?: TProperty<number | null>
  • minimumHeightProperty?: TProperty<number | null>
  • layoutOriginProperty?: TProperty<Vector2>
    If provided, will position content at an offset from the normal origin

Source Code

See the source for NodeLayoutConstraint.ts in the scenery repository.