MenuScene

open class MenuScene(    width: Number = DEFAULT_SCENE_WIDTH,     height: Number = DEFAULT_SCENE_HEIGHT,     background: Visual = ColorVisual.WHITE) : Scene<StaticComponentView<out StaticComponentView<*>>>

Baseclass for BGW menu scenes. Extend this class in order to create your own menu scene.

Parameters

width

Scene in virtual coordinates. Default: DEFAULT_SCENE_WIDTH.

height

Scene in virtual coordinates. Default: DEFAULT_SCENE_HEIGHT.

background

BoardGameSceneVisual. Default: ColorVisual.WHITE.

Constructors

Link copied to clipboard
fun MenuScene(    width: Number = DEFAULT_SCENE_WIDTH,     height: Number = DEFAULT_SCENE_HEIGHT,     background: Visual = ColorVisual.WHITE)

Functions

Link copied to clipboard
fun addComponents(vararg components: StaticComponentView<out StaticComponentView<*>>)

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: StaticComponentView<out StaticComponentView<*>>)

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<StaticComponentView<out StaticComponentView<*>>>

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?

Gets invoked with a KeyEvent whenever a key is pressed.

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

Gets invoked with a KeyEvent whenever a key is released.

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

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

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

Gets invoked with no event whenever a scene is hid.

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

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<StaticComponentView<out StaticComponentView<*>>>

The root node of this Scene.

Link copied to clipboard
val width: Double

The width of this Scene in virtual coordinates.