Scene

sealed class Scene<T : ComponentView>

Baseclass for BGW scenes.

See also

Parameters

T

Generic ComponentView.

width

Scene width in virtual coordinates.

height

Scene height in virtual coordinates.

background

Functions

Link copied to clipboard
fun addComponents(vararg components: T)

Adds all given ComponentViews to the root node and rootComponents list.

Link copied to clipboard
fun clearComponents()

Removes all ComponentViews from the root node and rootComponents list.

Link copied to clipboard
fun findPathToChild(node: ComponentView): List<ComponentView>

Searches node recursively through the visual tree and logs path where the node appears as first component and the rootNode as last.

Link copied to clipboard
fun playAnimation(animation: Animation)

Plays given Animation.

Link copied to clipboard
fun removeComponents(vararg components: T)

Removes all given ComponentViews from the root node and rootComponents list.

Properties

Link copied to clipboard
var background: Visual

The background Visual of this Scene.

Link copied to clipboard
val components: List<T>

Returns all root components that are currently contained in this Scene.

Link copied to clipboard
val draggedComponent: DynamicComponentView?

Currently dragged ComponentView encapsulated in a DragDataObject or null if no DynamicComponentView is currently dragged.

Link copied to clipboard
val height: Double

The height of this Scene in virtual coordinates.

Link copied to clipboard
var onKeyPressed: (KeyEvent) -> Unit? = null

Gets invoked with a KeyEvent whenever a key is pressed.

Link copied to clipboard
var onKeyReleased: (KeyEvent) -> Unit? = null

Gets invoked with a KeyEvent whenever a key is released.

Link copied to clipboard
var onKeyTyped: (KeyEvent) -> Unit? = null

Gets invoked with a KeyEvent whenever a Character is typed. Gets invoked after onKeyPressed .

Link copied to clipboard
var onSceneHid: () -> Unit? = null

Gets invoked with no event whenever a scene is hid.

Link copied to clipboard
var onSceneShown: () -> Unit? = null

Gets invoked with no event whenever a scene is shown.

Link copied to clipboard
var opacity: Double

Opacity of the background of this Scene.

Link copied to clipboard
val rootNode: RootComponent<T>

The root node of this Scene.

Link copied to clipboard
val width: Double

The width of this Scene in virtual coordinates.

Inheritors

Link copied to clipboard
Link copied to clipboard