Class LightSource

java.lang.Object
de.gurkenlabs.litiengine.entities.Entity
de.gurkenlabs.litiengine.entities.LightSource
All Implemented Interfaces:
EntityRenderedListener, EntityRenderListener, IEntity, IRenderable, Tweenable, EventListener

public class LightSource extends Entity implements IRenderable
  • Field Details

  • Constructor Details

    • LightSource

      public LightSource(int intensity, Color lightColor, LightSource.Type shapeType, boolean activated)
      Instantiates a new LightSource entity.
      Parameters:
      intensity - The intensity of this instance.
      lightColor - The color of this instance.
      shapeType - The shape type of this instance.
      activated - A flag indicating whether this light is activated by default.
  • Method Details

    • activate

      public void activate()
    • deactivate

      public void deactivate()
    • getColor

      public Color getColor()
    • getFocusOffsetX

      public double getFocusOffsetX()
    • getFocusOffsetY

      public double getFocusOffsetY()
    • getIntensity

      public int getIntensity()
    • getLightShape

      public Shape getLightShape()
    • getLightShapeType

      public LightSource.Type getLightShapeType()
    • getRadius

      public int getRadius()
    • isActive

      public boolean isActive()
    • setFocusOffsetX

      public void setFocusOffsetX(double focusOffsetX)
    • setFocusOffsetY

      public void setFocusOffsetY(double focusOffsetY)
    • setColor

      public void setColor(Color color)
    • setIntensity

      public void setIntensity(int intensity)
    • setLightShapeType

      public void setLightShapeType(LightSource.Type shapeType)
    • setX

      public void setX(double x)
      Specified by:
      setX in interface IEntity
      Overrides:
      setX in class Entity
    • setY

      public void setY(double y)
      Specified by:
      setY in interface IEntity
      Overrides:
      setY in class Entity
    • setWidth

      public void setWidth(double width)
      Specified by:
      setWidth in interface IEntity
      Overrides:
      setWidth in class Entity
    • setHeight

      public void setHeight(double height)
      Specified by:
      setHeight in interface IEntity
      Overrides:
      setHeight in class Entity
    • setLocation

      public void setLocation(Point2D location)
      Description copied from class: Entity
      Sets the map location.
      Specified by:
      setLocation in interface IEntity
      Overrides:
      setLocation in class Entity
      Parameters:
      location - the new map location
    • setSize

      public void setSize(double width, double height)
      Specified by:
      setSize in interface IEntity
      Overrides:
      setSize in class Entity
    • toggle

      public void toggle()
    • sendMessage

      public String sendMessage(Object sender, String message)
      Specified by:
      sendMessage in interface IEntity
      Overrides:
      sendMessage in class Entity
    • render

      public void render(Graphics2D graphic)
      Description copied from interface: IRenderable
      Renders the visual contents of this instance onto the provided graphics context.

      If an Entity implements this interface, this method will be called right after the entity was rendered from the environment. Allowing for a custom rendering mechanism.

      This interface can be implemented in general by anything that should be rendered to the game's screen.

      Specified by:
      render in interface IRenderable
      Parameters:
      graphic - The current graphics object onto which this instance will render its visual contents.
      See Also: