public interface Display extends UserProfileSavable
| Type | Property and Description |
|---|---|
javafx.beans.property.ReadOnlyObjectProperty<FXGLScene> |
currentScene |
| Modifier and Type | Method and Description |
|---|---|
javafx.beans.property.ReadOnlyObjectProperty<FXGLScene> |
currentSceneProperty() |
javafx.geometry.Rectangle2D |
getBounds()
Returns available (visual) bounds of the physical display.
|
default FXGLScene |
getCurrentScene() |
double |
getScaleRatio() |
List<SceneDimension> |
getSceneDimensions() |
void |
registerScene(FXGLScene scene)
Register an FXGL scene to be managed by display settings.
|
boolean |
saveScreenshot()
Saves a screenshot of the current scene into a ".png" file.
|
void |
setScene(FXGLScene scene)
Set current FXGL scene.
|
void |
setSceneDimension(SceneDimension dimension)
Set new scene dimension.
|
void |
showBox(String message,
javafx.scene.Node content,
javafx.scene.control.Button... buttons)
Shows a blocking (stops game execution, method returns normally) generic dialog.
|
void |
showConfirmationBox(String message,
Consumer<Boolean> resultCallback)
Shows a blocking message box with YES and NO buttons.
|
<T> void |
showDialog(javafx.scene.control.Dialog<T> dialog,
Consumer<T> resultCallback)
Shows given dialog and blocks execution of the game until the dialog is
dismissed.
|
void |
showErrorBox(String errorMessage,
Runnable callback)
Shows a blocking (stops game execution, method returns normally) dialog with the error.
|
void |
showErrorBox(Throwable error)
Shows a blocking (stops game execution, method returns normally) dialog with the error.
|
void |
showInputBox(String message,
Consumer<String> resultCallback)
Shows a blocking (stops game execution, method returns normally) message box with OK button and input field.
|
void |
showInputBox(String message,
Predicate<String> filter,
Consumer<String> resultCallback)
Shows a blocking (stops game execution, method returns normally) message box with OK button and input field.
|
void |
showInputBoxWithCancel(String message,
Predicate<String> filter,
Consumer<String> resultCallback)
Shows a blocking (stops game execution, method returns normally) message box with OK and CANCEL buttons and input field.
|
void |
showMessageBox(String message)
Shows a blocking (stops game execution, method returns normally) message box with OK button.
|
void |
showMessageBox(String message,
Runnable callback)
Shows a blocking (stops game execution, method returns normally) message box with OK button.
|
UIDialogHandler |
showProgressBox(String message)
Shows a blocking (stops game execution, method returns normally) progress dialog.
|
load, savejavafx.beans.property.ReadOnlyObjectProperty<FXGLScene> currentSceneProperty
getCurrentScene()void registerScene(FXGLScene scene)
scene - the scenevoid setScene(FXGLScene scene)
scene - the scenejavafx.beans.property.ReadOnlyObjectProperty<FXGLScene> currentSceneProperty()
getCurrentScene()default FXGLScene getCurrentScene()
javafx.geometry.Rectangle2D getBounds()
boolean saveScreenshot()
List<SceneDimension> getSceneDimensions()
void setSceneDimension(SceneDimension dimension)
dimension - scene dimensiondouble getScaleRatio()
<T> void showDialog(javafx.scene.control.Dialog<T> dialog,
Consumer<T> resultCallback)
dialog - JavaFX dialogresultCallback - the function to be calledvoid showMessageBox(String message)
message - the message to showvoid showMessageBox(String message, Runnable callback)
message - the message to showcallback - the function to be called when dialog is dismissedvoid showConfirmationBox(String message, Consumer<Boolean> resultCallback)
message - message to showresultCallback - the function to be calledvoid showInputBox(String message, Consumer<String> resultCallback)
message - message to showresultCallback - the function to be calledvoid showInputBox(String message, Predicate<String> filter, Consumer<String> resultCallback)
message - message to showfilter - filter to validate inputresultCallback - the function to be calledvoid showInputBoxWithCancel(String message, Predicate<String> filter, Consumer<String> resultCallback)
message - message to showfilter - the filter to validate inputresultCallback - result function to call back or empty string if use cancelled the dialogvoid showErrorBox(Throwable error)
error - the error to showvoid showErrorBox(String errorMessage, Runnable callback)
errorMessage - error message to showcallback - the function to be called when dialog is dismissedvoid showBox(String message, javafx.scene.Node content, javafx.scene.control.Button... buttons)
message - the messagecontent - the contentbuttons - buttons presentUIDialogHandler showProgressBox(String message)
message - message to showCopyright © 2017. All rights reserved.