Skip to content

Screen

Under Construction

This documentation is auto-generated, and is a work in progress. Please see the source code at https://github.com/phetsims/joist/blob/main/js/Screen.ts for the most up-to-date information.

Overview

A Screen is the largest chunk of a simulation. (Java sims used the term Module, but that term is too overloaded to use with JavaScript and Git.)

When creating a Sim, Screens are supplied as the arguments. They can be specified as object literals or through instances of this class. This class may centralize default behavior or state for Screens in the future, but right now it only allows you to create Sims without using named parameter object literals.

@author Sam Reid (PhET Interactive Simulations)

Class Screen

Parameterized on M=Model and V=View

import { Screen } from 'scenerystack/sim';

Constructor

new Screen( createModel : () => M, createView : ( model: M ) => V, providedOptions : ScreenOptions )

Instance Methods

hasModel() : boolean

hasView() : boolean

reset()

Instance Properties

backgroundColorProperty : Property<Color> | Property<string> | Property<Color | string>

maxDT : number

(readonly)

dt cap in seconds, see https://github.com/phetsims/joist/issues/130

activeProperty : BooleanProperty

(readonly)

screenButtonsHelpText : PDOMValueType

(readonly)

Help text used on the screen buttons, see options above.

nameProperty : TReadOnlyProperty<string>

(readonly)

showScreenIconFrameForNavigationBarFill : string | null

(readonly)

homeScreenIcon : ScreenIcon | null

(readonly)

showUnselectedHomeScreenIconFrame : boolean

(readonly)

createKeyboardHelpNode : null | ( ( tandem: Tandem ) => Node )

(readonly)

pdomDisplayNameProperty : TReadOnlyProperty<string>

(readonly)

Static Properties

HOME_SCREEN_ICON_ASPECT_RATIO

(readonly)

MINIMUM_HOME_SCREEN_ICON_SIZE

(readonly)

MINIMUM_NAVBAR_ICON_SIZE

(readonly)

ScreenIO : IOType

(readonly)

Type ScreenOptions

import type { ScreenOptions } from 'scenerystack/sim';

Source Code

See the source for Screen.ts in the joist repository.