Skip to content

LayoutJustification

Overview

Rich enumeration for internal layout code

NOTE: This is orientation-agnostic for a reason, so that it's natural with GridBox, and FlowBox can switch orientation

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

Class LayoutJustification

import { LayoutJustification } from 'scenerystack/scenery';

Constructor

new LayoutJustification( spacingFunctionFactory : SpaceRemainingFunctionFactory, horizontal : HorizontalLayoutJustification, vertical : VerticalLayoutJustification )

Instance Methods

Instance Properties

horizontal : HorizontalLayoutJustification

(readonly)

String enumeration types for the horizontal orientation

vertical : VerticalLayoutJustification

(readonly)

String enumeration types for the vertical orientation

spacingFunctionFactory : SpaceRemainingFunctionFactory

(readonly)

See SpaceRemainingFunctionFactory for docs

Static Methods

getAllowedJustificationValues( orientation : Orientation ) : readonly string[]

justifyToInternal( orientation : Orientation, key : HorizontalLayoutJustification | VerticalLayoutJustification ) : LayoutJustification

Converts a string union value into the internal Enumeration value

internalToJustify( orientation : Orientation, justify : LayoutJustification ) : HorizontalLayoutJustification | VerticalLayoutJustification

Converts an internal Enumeration value into a string union value.

Static Properties

START : LayoutJustification

(readonly)

END : LayoutJustification

(readonly)

CENTER : LayoutJustification

(readonly)

SPACE_BETWEEN : LayoutJustification

(readonly)

SPACE_AROUND : LayoutJustification

(readonly)

SPACE_EVENLY : LayoutJustification

(readonly)

enumeration : Enumeration

(readonly)

Type HorizontalLayoutJustification

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

"left" | "right" | "center" | "spaceBetween" | "spaceAround" | "spaceEvenly"

Type VerticalLayoutJustification

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

"top" | "bottom" | "center" | "spaceBetween" | "spaceAround" | "spaceEvenly"

Source Code

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