Class SolaGraphics

java.lang.Object
technology.sola.engine.defaults.SolaGraphics

public class SolaGraphics extends Object
SolaGraphics provides default rendering capabilities while also allowing for adding new rendering capabilities via SolaGraphicsModules.
  • Constructor Details

    • SolaGraphics

      public SolaGraphics(technology.sola.ecs.SolaEcs solaEcs)
      Creates a SolaGraphics instance.
      Parameters:
      solaEcs - the SolaEcs instance
  • Method Details

    • addGraphicsModules

      public void addGraphicsModules(SolaGraphicsModule... graphicsModules)
      Adds SolaGraphicsModules to be rendered.
      Parameters:
      graphicsModules - the modules to add
    • getGraphicsModule

      public <T extends SolaGraphicsModule> T getGraphicsModule(Class<T> solaGraphicsModuleClass)
      Gets a SolaGraphicsModule that has been added or else null.
      Type Parameters:
      T - the type of graphics module
      Parameters:
      solaGraphicsModuleClass - the class of the SolaGraphicsModule
      Returns:
      the graphics module
    • getSystems

      public technology.sola.ecs.EcsSystem[] getSystems()
      Returns:
      an array of all graphics related EcsSystems
    • render

      public void render(Renderer renderer)
      Renders all SolaGraphicsModules that have been added. Passes each the current camera's translation and scale.
      Parameters:
      renderer - the Renderer instance
    • screenToWorldCoordinate

      public Vector2D screenToWorldCoordinate(Vector2D screenCoordinate)
      Using the camera's transform, this method calculates the World coordinate based on the screen's coordinate system.
      Parameters:
      screenCoordinate - the coordinate of the screen to map
      Returns:
      the coordinate mapped to the World's coordinate system