public final class GameSettings extends ReadOnlyGameSettings
Modifying any data after the start of the game has no effect.
appMode, closeConfirmation, credits, enabledMenuItems, fullScreen, height, introEnabled, menuEnabled, menuKey, profilingEnabled, services, title, version, width| Constructor and Description |
|---|
GameSettings() |
| Modifier and Type | Method and Description |
|---|---|
void |
addServiceType(ServiceType<?> serviceType)
Register a custom service with FXGL.
|
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 |
setEnabledMenuItems(EnumSet<MenuItem> items) |
void |
setFullScreen(boolean b)
Setting to true will start the game in fullscreen mode.
|
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 |
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 |
setProfilingEnabled(boolean b)
Setting to true will enable profiler that reports on performance
when FXGL exits.
|
void |
setTitle(String title)
Set title of the game.
|
void |
setVersion(String version)
Set version of the game.
|
void |
setWidth(int width)
Set target width.
|
ReadOnlyGameSettings |
toReadOnly() |
getApplicationMode, getCredits, getEnabledMenuItems, getHeight, getMenuKey, getServices, getTitle, getVersion, getWidth, isCloseConfirmation, isFullScreen, isIntroEnabled, isMenuEnabled, isProfilingEnabled, 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 setFullScreen(boolean b)
b - fullscreen flagpublic void setProfilingEnabled(boolean b)
b - profiling enabled flagpublic void setCloseConfirmation(boolean b)
b - ask for confirmation on closepublic 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 addServiceType(ServiceType<?> serviceType)
serviceType - type of servicepublic ReadOnlyGameSettings toReadOnly()
Copyright © 2017. All rights reserved.