public final class GameSettings extends ReadOnlyGameSettings
Modifying any data after the start of the game has no effect.
appMode, closeConfirmation, credits, dialogFactory, enabledMenuItems, exceptionHandler, fullScreenAllowed, height, introEnabled, manualResizeEnabled, menuEnabled, menuKey, notificationViewClass, profilingEnabled, sceneFactory, singleStep, stageStyle, title, uiFactory, version, width| Constructor and Description |
|---|
GameSettings() |
| Modifier and Type | Method and Description |
|---|---|
void |
setApplicationMode(ApplicationMode mode)
Sets application run mode.
|
void |
setCloseConfirmation(boolean b)
Setting to false will disable asking for confirmation on exit.
|
void |
setCredits(Credits credits)
Set additional credits.
|
void |
setDialogFactory(DialogFactory dialogFactory)
Provide a custom dialog factory.
|
void |
setEnabledMenuItems(EnumSet<MenuItem> items) |
void |
setExceptionHandler(ExceptionHandler exceptionHandler)
Provide a custom exception handler.
|
void |
setFullScreenAllowed(boolean b)
Setting to true will allow the game to be able to enter full screen
from the menu.
|
void |
setHeight(int height)
Set target height.
|
void |
setIntroEnabled(boolean b)
If set to true, the intro video/animation will
be played before the start of the game.
|
void |
setManualResizeEnabled(boolean enabled)
If enabled, users can drag the corner of the main window
to resize it and the game.
|
void |
setMenuEnabled(boolean b)
Setting to true enables main and game menu.
|
void |
setMenuKey(javafx.scene.input.KeyCode menuKey)
Set the key that will trigger in-game menu.
|
void |
setNotificationViewFactory(Class<? extends NotificationView> notificationViewFactory)
Provide a custom notification service.
|
void |
setProfilingEnabled(boolean b)
Setting to true will enable profiler that reports on performance
when FXGL exits.
|
void |
setSceneFactory(SceneFactory sceneFactory)
Provide a custom scene factory.
|
void |
setSingleStep(boolean b) |
void |
setStageStyle(javafx.stage.StageStyle stageStyle) |
void |
setTitle(String title)
Set title of the game.
|
void |
setUIFactory(UIFactory uiFactory)
Provide a custom UI factory.
|
void |
setVersion(String version)
Set version of the game.
|
void |
setWidth(int width)
Set target width.
|
ReadOnlyGameSettings |
toReadOnly() |
getApplicationMode, getCredits, getDialogFactory, getEnabledMenuItems, getExceptionHandler, getHeight, getMenuKey, getNotificationViewFactory, getSceneFactory, getStageStyle, getTitle, getUIFactory, getVersion, getWidth, isCloseConfirmation, isFullScreenAllowed, isIntroEnabled, isManualResizeEnabled, isMenuEnabled, isProfilingEnabled, isSingleStep, toStringpublic void setTitle(String title)
title - app titlepublic void setWidth(int width)
All the game logic must use target width and height.
width - target widthpublic void setHeight(int height)
All the game logic must use target width and height.
height - target heightpublic void setVersion(String version)
version - app versionpublic void setIntroEnabled(boolean b)
b - intro flagpublic void setMenuEnabled(boolean b)
b - menu flagpublic void setFullScreenAllowed(boolean b)
b - fullscreen flagpublic void setProfilingEnabled(boolean b)
b - profiling enabled flagpublic void setCloseConfirmation(boolean b)
b - ask for confirmation on closepublic void setSingleStep(boolean b)
public void setApplicationMode(ApplicationMode mode)
ApplicationMode for more info.mode - app modeApplicationMode#DEVELOPERpublic void setMenuKey(javafx.scene.input.KeyCode menuKey)
menuKey - menu keypublic void setCredits(Credits credits)
credits - credits objectpublic void setManualResizeEnabled(boolean enabled)
public void setStageStyle(javafx.stage.StageStyle stageStyle)
public void setSceneFactory(SceneFactory sceneFactory)
public void setDialogFactory(DialogFactory dialogFactory)
public void setUIFactory(UIFactory uiFactory)
public void setNotificationViewFactory(Class<? extends NotificationView> notificationViewFactory)
public void setExceptionHandler(ExceptionHandler exceptionHandler)
public ReadOnlyGameSettings toReadOnly()
Copyright © 2017. All rights reserved.