java.lang.Object
technology.sola.engine.core.Sola
Sola contains the core functionality needed to make a game. It is played via
SolaPlatform.-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected AssetLoaderProviderUsed to load assets for the Sola to use.protected final SolaConfigurationThe configuration for this Solaprotected EventHubTheEventHubinstance used by this Solaprotected KeyboardInputUsed to check the current state of keyboard input.protected MouseInputUsed to check the current state of mouse input.protected technology.sola.ecs.SolaEcsTheSolaEcsinstance used by this Solaprotected TouchInputUsed to check the current state of touch input. -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedSola(SolaConfiguration configuration) Creates a Sola instance with desiredSolaConfiguration. -
Method Summary
Modifier and TypeMethodDescriptionprotected voidonAsyncInit(Runnable completeAsyncInit) Method called if any asynchronous initialization is needed.protected abstract voidonInit()Method called to initialize the Sola.protected abstract voidMethod called every frame to render the world.protected voidonUpdate(float deltaTime) Method called every frame to update the input and world state.protected SolaPlatformplatform()
-
Field Details
-
configuration
The configuration for this Sola -
solaEcs
protected technology.sola.ecs.SolaEcs solaEcsTheSolaEcsinstance used by this Sola -
eventHub
TheEventHubinstance used by this Sola -
keyboardInput
Used to check the current state of keyboard input. -
mouseInput
Used to check the current state of mouse input. -
touchInput
Used to check the current state of touch input. -
assetLoaderProvider
Used to load assets for the Sola to use.
-
-
Constructor Details
-
Sola
Creates a Sola instance with desiredSolaConfiguration.- Parameters:
configuration- the configuration for the Sola
-
-
Method Details
-
onInit
protected abstract void onInit()Method called to initialize the Sola. -
onAsyncInit
Method called if any asynchronous initialization is needed. Call completeAsyncInit.run() when completed to continue starting the Sola.Note: No render calls will happen until this async initialization has completed, so be careful!
- Parameters:
completeAsyncInit- the callback to notify the hosting platform initialization is complete
-
onRender
Method called every frame to render the world.- Parameters:
renderer- theRendererinstance
-
platform
- Returns:
- the
SolaPlatformrunning this Sola.
-
onUpdate
protected void onUpdate(float deltaTime) Method called every frame to update the input and world state.- Parameters:
deltaTime- the time since the last update
-