Class AmbientLight

java.lang.Object
de.gurkenlabs.litiengine.graphics.ColorLayer
de.gurkenlabs.litiengine.graphics.AmbientLight
All Implemented Interfaces:
IRenderable

public class AmbientLight extends ColorLayer
This class represents the ambient light in an environment. It extends the ColorLayer class and provides methods to render light sources and shadows.
  • Field Details

    • DEFAULT_COLOR

      public static final Color DEFAULT_COLOR
      The default color for the ambient light.
  • Constructor Details

    • AmbientLight

      public AmbientLight(Environment environment, Color ambientColor)
      Constructor for the AmbientLight class.
      Parameters:
      environment - The environment to which this instance is assigned.
      ambientColor - The color of this instance.
  • Method Details

    • renderSection

      protected void renderSection(Graphics2D g, Rectangle2D section)
      Renders a section of the environment with the ambient light and light sources.
      Specified by:
      renderSection in class ColorLayer
      Parameters:
      g - The Graphics2D object to render on.
      section - The section of the environment to render.
    • clearSection

      protected void clearSection(Graphics2D g, Rectangle2D section)
      Clears a section of the environment.
      Specified by:
      clearSection in class ColorLayer
      Parameters:
      g - The Graphics2D object to clear on.
      section - The section of the environment to clear.