public abstract class FXGLMenu extends FXGLScene
activeProperty
Modifier and Type | Class and Description |
---|---|
protected static class |
FXGLMenu.MenuContent
A generic vertical box container for menu content
where each element is followed by a separator.
|
Modifier and Type | Field and Description |
---|---|
protected GameApplication |
app |
protected javafx.scene.layout.Pane |
contentRoot |
protected FXGLMenu.MenuContent |
EMPTY |
protected MenuEventHandler |
listener |
protected static Logger |
log |
protected javafx.scene.layout.Pane |
menuRoot |
protected MenuType |
type |
Constructor and Description |
---|
FXGLMenu(GameApplication app,
MenuType type) |
Modifier and Type | Method and Description |
---|---|
protected void |
addUINode(javafx.scene.Node node)
Adds a UI node.
|
protected abstract javafx.scene.control.Button |
createActionButton(javafx.beans.binding.StringBinding name,
Runnable action) |
protected abstract javafx.scene.control.Button |
createActionButton(String name,
Runnable action) |
protected abstract javafx.scene.Node |
createBackground(double width,
double height)
Create menu background.
|
protected FXGLMenu.MenuContent |
createContentAchievements() |
protected FXGLMenu.MenuContent |
createContentAudio() |
protected javafx.scene.control.Button |
createContentButton(javafx.beans.binding.StringBinding name,
Supplier<FXGLMenu.MenuContent> contentSupplier) |
protected javafx.scene.control.Button |
createContentButton(String name,
Supplier<FXGLMenu.MenuContent> contentSupplier) |
protected FXGLMenu.MenuContent |
createContentControls() |
protected FXGLMenu.MenuContent |
createContentCredits() |
protected FXGLMenu.MenuContent |
createContentFeedback() |
protected FXGLMenu.MenuContent |
createContentGameplay() |
protected FXGLMenu.MenuContent |
createContentLoad() |
protected FXGLMenu.MenuContent |
createContentVideo()
https://github.com/AlmasB/FXGL/issues/493
|
protected abstract javafx.scene.Node |
createProfileView(String profileName)
Create view for profile name.
|
protected abstract javafx.scene.Node |
createTitleView(String title)
Create view for the app title.
|
protected abstract javafx.scene.Node |
createVersionView(String version)
Create view for version string.
|
protected void |
fireContinue()
Loads the game state from last modified save file.
|
protected void |
fireDelete(SaveFile fileName) |
protected void |
fireExit()
App will clean up the world/the scene and exit.
|
protected void |
fireExitToMainMenu()
App will clean up the world/the scene and enter main menu.
|
protected void |
fireLoad(SaveFile fileName)
Loads the game state from previously saved file.
|
protected void |
fireLogout()
Can only be fired from main menu.
|
protected void |
fireMultiplayer()
Call multiplayer access in main menu.
|
protected void |
fireNewGame()
Can only be fired from main menu.
|
protected void |
fireResume()
Can only be fired from game menu.
|
protected void |
fireSave()
Can only be fired from game menu.
|
protected void |
switchMenuContentTo(javafx.scene.Node content)
Switches current active content to given.
|
protected void |
switchMenuTo(javafx.scene.Node menuBox)
Switches current active menu body to given.
|
activeProperty, appendCSS, bindSize, clearCSS, clearEffect, getContentRoot, getEffect, getHeight, getRoot, getViewport, getWidth, setBackgroundColor, setBackgroundRepeat, setBackgroundRepeat, setCursor, setEffect
protected static final Logger log
protected final GameApplication app
protected final MenuType type
protected MenuEventHandler listener
protected final javafx.scene.layout.Pane menuRoot
protected final javafx.scene.layout.Pane contentRoot
protected final FXGLMenu.MenuContent EMPTY
public FXGLMenu(GameApplication app, MenuType type)
protected void switchMenuTo(javafx.scene.Node menuBox)
menuBox
- parent node containing menu bodyprotected void switchMenuContentTo(javafx.scene.Node content)
content
- menu contentprotected abstract javafx.scene.control.Button createActionButton(String name, Runnable action)
protected abstract javafx.scene.control.Button createActionButton(javafx.beans.binding.StringBinding name, Runnable action)
protected javafx.scene.control.Button createContentButton(String name, Supplier<FXGLMenu.MenuContent> contentSupplier)
protected javafx.scene.control.Button createContentButton(javafx.beans.binding.StringBinding name, Supplier<FXGLMenu.MenuContent> contentSupplier)
protected abstract javafx.scene.Node createBackground(double width, double height)
width
- width of the appheight
- height of the appprotected abstract javafx.scene.Node createTitleView(String title)
title
- app titleprotected abstract javafx.scene.Node createVersionView(String version)
version
- version stringprotected abstract javafx.scene.Node createProfileView(String profileName)
profileName
- profile user nameprotected final FXGLMenu.MenuContent createContentLoad()
protected final FXGLMenu.MenuContent createContentGameplay()
protected final FXGLMenu.MenuContent createContentControls()
protected final FXGLMenu.MenuContent createContentVideo()
protected final FXGLMenu.MenuContent createContentAudio()
protected final FXGLMenu.MenuContent createContentCredits()
protected final FXGLMenu.MenuContent createContentFeedback()
protected final FXGLMenu.MenuContent createContentAchievements()
protected final void addUINode(javafx.scene.Node node)
node
- the node to addprotected final void fireNewGame()
protected final void fireContinue()
protected final void fireLoad(SaveFile fileName)
fileName
- name of the saved fileprotected final void fireSave()
protected final void fireDelete(SaveFile fileName)
fileName
- name of the save fileprotected final void fireResume()
protected final void fireLogout()
protected final void fireMultiplayer()
protected final void fireExit()
protected final void fireExitToMainMenu()
Copyright © 2018. All rights reserved.