public abstract class Platform
extends java.lang.Object
| Modifier and Type | Class and Description |
|---|---|
static class |
Platform.Error
|
static class |
Platform.Lifecycle
Defines the lifecycle events.
|
static class |
Platform.Type
Enumerates the supported platform types.
|
| Modifier and Type | Field and Description |
|---|---|
Signal<Platform.Error> |
errors
Any errors reported via
reportError(java.lang.String, java.lang.Throwable) will be emitted to this signal in addition to
being logged. |
Signal<Platform> |
frame
This signal will be emitted at the start of every frame after the platform is started.
|
Signal<Platform.Lifecycle> |
lifecycle
A signal emitted with lifecycle events.
|
| Constructor and Description |
|---|
Platform() |
| Modifier and Type | Method and Description |
|---|---|
abstract Assets |
assets()
Returns the
Assets service. |
abstract Audio |
audio()
Returns the
Audio service. |
<E> void |
dispatchEvent(Signal<E> signal,
E event)
Dispatches
event on signal and catches any error that propagates out of the
event dispatch, reporting it via reportError(java.lang.String, java.lang.Throwable). |
abstract Exec |
exec()
Returns the
Exec service. |
abstract Graphics |
graphics()
Returns the
Graphics service. |
abstract Input |
input()
Returns the
Input service. |
void |
invokeAsync(java.lang.Runnable action)
Deprecated.
|
void |
invokeLater(java.lang.Runnable runnable)
Deprecated.
|
boolean |
isAsyncSupported()
Deprecated.
|
abstract Json |
json()
Returns the
Json service. |
abstract Log |
log()
Returns the
Log service. |
abstract Net |
net()
Returns the
Net service. |
abstract void |
openURL(java.lang.String url)
Opens the given URL in the default browser.
|
void |
reportError(java.lang.String message,
java.lang.Throwable cause)
Called when a backend (or other framework code) encounters an exception that it can recover
from, but which it would like to report in some orderly fashion.
|
abstract Storage |
storage()
Returns the
Storage storage service. |
abstract int |
tick()
Returns the number of milliseconds that have elapsed since the game started.
|
abstract double |
time()
Returns the current time, as a double value in millis since January 1, 1970, 00:00:00 GMT.
|
abstract Platform.Type |
type()
Returns the platform
Platform.Type. |
public Signal<Platform.Lifecycle> lifecycle
public Signal<Platform> frame
public Signal<Platform.Error> errors
reportError(java.lang.String, java.lang.Throwable) will be emitted to this signal in addition to
being logged. Games can connect to this signal if they wish to capture and record platform
errors.public abstract Platform.Type type()
Platform.Type.public abstract double time()
new Date().getTime();, but is terser and
avoids the use of long, which is best avoided when translating to JavaScript.public abstract int tick()
public abstract void openURL(java.lang.String url)
public void reportError(java.lang.String message,
java.lang.Throwable cause)
public <E> void dispatchEvent(Signal<E> signal, E event)
event on signal and catches any error that propagates out of the
event dispatch, reporting it via reportError(java.lang.String, java.lang.Throwable).@Deprecated public void invokeLater(java.lang.Runnable runnable)
Exec.invokeLater(java.lang.Runnable).@Deprecated public boolean isAsyncSupported()
Exec.isAsyncSupported().@Deprecated public void invokeAsync(java.lang.Runnable action)
Exec.invokeAsync(java.lang.Runnable).Copyright © 2018. All Rights Reserved.