Scene

Scene component - the root node of a SceneGraph application

import { Scene } from "@roku-sdk/components";
Scene(props: ISceneProps): JSX.Element

Description

Scene component - the root node of a SceneGraph application.

Parameters

NameTypeDescription
propsISceneProps

Types

ISceneProps

Properties for the Scene node.

Scene is the root node of a SceneGraph application. Every roSGScreen object must have exactly one Scene node as its root. The Scene node provides background rendering, dialog management, and design resolution information.

NameTypeDescription
backExitsScene?booleanIf true, a Back key press causes the scene to exit. If false, Back key doesn't exit the scene. Requires focus to be set on the scene or a child node.
backgroundColor?stringSpecifies a background color for the scene as a hex string (e.g., "0x000000FF"). Only used if backgroundURI is set to an empty string.
backgroundURI?UriSpecifies a graphic image file to be used for the Scene node background.
dialog?ElementSetting this field to a node extended from Dialog causes the dialog to be displayed. Set to invalid to dismiss the dialog.
limitBackgroundToUIResolution?booleanIf true, the backgroundURI image is limited to the current screen size after being loaded. If false, no scaling is applied.
onCurrentDesignResolution?EventHandler<DesignResolution>Event fired when the current design resolution changes. Returns the width, height, and resolution mode ("HD", "FHD", or "SD").
palette?ElementDefines the default color palette used by nodes that have a palette field, such as standard dialogs and keyboards.

Extends IGroupProps.

DesignResolution

Represents the current design resolution of the scene.

NameTypeDescription
heightnumberThe height of the design resolution in pixels.
resolution"HD" | "FHD" | "SD"The resolution mode.
widthnumberThe width of the design resolution in pixels.

What’s Next

Did this page help you?