java.lang.Object
technology.sola.engine.graphics.SolaGraphics.Builder
- Enclosing class:
- SolaGraphics
Builder for
SolaGraphics
.-
Constructor Summary
ConstructorsConstructorDescriptionBuilder
(SolaPlatform platform, technology.sola.ecs.SolaEcs solaEcs) Creates a newSolaGraphics.Builder
instance. -
Method Summary
Modifier and TypeMethodDescriptionbuildAndInitialize
(AssetLoaderProvider assetLoaderProvider) Builds and initializes theSolaGraphics
instance.withBackgroundColor
(Color backgroundColor) Sets the backgroundColor
cleared to each frame.withDebug
(@Nullable SolaPhysics solaPhysics, EventHub eventHub, KeyboardInput keyboardInput) Enables debug rendering.withGui
(MouseInput mouseInput) Sets the builder to add aGuiDocument
and related systems.withGui
(MouseInput mouseInput, GuiTheme guiTheme) Sets the builder to add aGuiDocument
and related systems.withGui
(MouseInput mouseInput, GuiTheme guiTheme, List<GuiElementJsonBlueprint<?, ?, ?>> additionalGuiElementJsonBlueprints) Sets the builder to add aGuiDocument
and related systems.Sets the builder to add lighting related graphics modules and systems.withLighting
(Color ambientLightColor) Sets the builder to add lighting related graphics modules and systems.Sets the builder to not add the defaultSolaGraphicsModule
s when initializing theSolaGraphics
instance.
-
Constructor Details
-
Builder
Creates a newSolaGraphics.Builder
instance.- Parameters:
platform
- theSolaPlatform
instancesolaEcs
- theSolaEcs
instance to attach systems to
-
-
Method Details
-
withBackgroundColor
Sets the backgroundColor
cleared to each frame.- Parameters:
backgroundColor
- theColor
to clear to (defaults toColor.BLACK
- Returns:
- this
-
withoutDefaultGraphicsModules
Sets the builder to not add the defaultSolaGraphicsModule
s when initializing theSolaGraphics
instance.- Returns:
- this
-
withLighting
Sets the builder to add lighting related graphics modules and systems. Sets the ambient light color toColor.BLACK
.- Returns:
- this
-
withLighting
Sets the builder to add lighting related graphics modules and systems. Sets the ambient light color to the desired color.- Parameters:
ambientLightColor
- the color to set the ambient light to- Returns:
- this
-
withGui
Sets the builder to add aGuiDocument
and related systems. UsesDefaultThemeBuilder.buildLightTheme()
for the theme.- Parameters:
mouseInput
- theMouseInput
instance to use for theGuiDocument
- Returns:
- this
-
withGui
Sets the builder to add aGuiDocument
and related systems. Uses desiredGuiTheme
.- Parameters:
mouseInput
- theMouseInput
instance to use for theGuiDocument
guiTheme
- theGuiTheme
to use for theGuiDocument
- Returns:
- this
-
withGui
public SolaGraphics.Builder withGui(MouseInput mouseInput, GuiTheme guiTheme, List<GuiElementJsonBlueprint<?, ?, ?>> additionalGuiElementJsonBlueprints) Sets the builder to add aGuiDocument
and related systems. Uses desiredGuiTheme
. Also registers additionalGuiElementJsonBlueprint
s.- Parameters:
mouseInput
- theMouseInput
instance to use for theGuiDocument
guiTheme
- theGuiTheme
to use for theGuiDocument
additionalGuiElementJsonBlueprints
- additionalGuiElementJsonBlueprint
s to add to theGuiDocument
- Returns:
- this
-
withDebug
public SolaGraphics.Builder withDebug(@Nullable SolaPhysics solaPhysics, EventHub eventHub, KeyboardInput keyboardInput) Enables debug rendering. IfSolaPhysics
is provided then collision debug rendering will also be present.- Parameters:
solaPhysics
- the optionalSolaPhysics
instance to attach toeventHub
- theEventHub
to add listeners tokeyboardInput
- theKeyboardInput
to control debug rendering state- Returns:
- this
-
buildAndInitialize
Builds and initializes theSolaGraphics
instance. This will add requiredEcsSystem
s,AssetLoader
s, aDefaultFont
andSolaGraphicsModule
s.- Parameters:
assetLoaderProvider
- theAssetLoaderProvider
- Returns:
- the initialized
SolaGraphics
instance
-