Class LightSource
java.lang.Object
de.gurkenlabs.litiengine.entities.Entity
de.gurkenlabs.litiengine.entities.LightSource
- All Implemented Interfaces:
EntityRenderedListener,EntityRenderListener,IEntity,IRenderable,Tweenable,EventListener
-
Nested Class Summary
Nested Classes -
Field Summary
FieldsFields inherited from class de.gurkenlabs.litiengine.entities.Entity
ANY_MESSAGE -
Constructor Summary
ConstructorsConstructorDescriptionLightSource(int intensity, Color lightColor, LightSource.Type shapeType, boolean activated) Instantiates a newLightSourceentity. -
Method Summary
Modifier and TypeMethodDescriptionvoidactivate()voidgetColor()doubledoubleintintbooleanisActive()voidrender(Graphics2D graphic) Renders the visual contents of this instance onto the provided graphics context.sendMessage(Object sender, String message) voidvoidsetFocusOffsetX(double focusOffsetX) voidsetFocusOffsetY(double focusOffsetY) voidsetHeight(double height) voidsetIntensity(int intensity) voidsetLightShapeType(LightSource.Type shapeType) voidsetLocation(Point2D location) Sets the map location.voidsetSize(double width, double height) voidsetWidth(double width) voidsetX(double x) voidsetY(double y) voidtoggle()Methods inherited from class de.gurkenlabs.litiengine.entities.Entity
actions, addController, addEntityRenderListener, addListener, addTag, addTransformListener, animations, attachControllers, behavior, canRender, detachControllers, getAngle, getBoundingBox, getCenter, getController, getControllers, getEnvironment, getHeight, getLocation, getMapId, getName, getProperties, getRenderType, getTags, getTweenValues, getWidth, getX, getY, hasTag, isLoaded, isVisible, loaded, onMessage, onMessage, onRendered, perform, register, removed, removeListener, removeListener, removeListener, removeListener, removeListener, removeTag, rendered, rendering, renderWithLayer, setAngle, setController, setLocation, setMapId, setName, setRenderType, setRenderWithLayer, setTweenValues, setVisible, toString
-
Field Details
-
TOGGLE_MESSAGE
- See Also:
-
DEFAULT_INTENSITY
public static final int DEFAULT_INTENSITY- See Also:
-
-
Constructor Details
-
LightSource
Instantiates a newLightSourceentity.- 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
-
getFocusOffsetX
public double getFocusOffsetX() -
getFocusOffsetY
public double getFocusOffsetY() -
getIntensity
public int getIntensity() -
getLightShape
-
getLightShapeType
-
getRadius
public int getRadius() -
isActive
public boolean isActive() -
setFocusOffsetX
public void setFocusOffsetX(double focusOffsetX) -
setFocusOffsetY
public void setFocusOffsetY(double focusOffsetY) -
setColor
-
setIntensity
public void setIntensity(int intensity) -
setLightShapeType
-
setX
public void setX(double x) -
setY
public void setY(double y) -
setWidth
public void setWidth(double width) -
setHeight
public void setHeight(double height) -
setLocation
Description copied from class:EntitySets the map location.- Specified by:
setLocationin interfaceIEntity- Overrides:
setLocationin classEntity- Parameters:
location- the new map location
-
setSize
public void setSize(double width, double height) -
toggle
public void toggle() -
sendMessage
- Specified by:
sendMessagein interfaceIEntity- Overrides:
sendMessagein classEntity
-
render
Description copied from interface:IRenderableRenders the visual contents of this instance onto the provided graphics context.If an
Entityimplements 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:
renderin interfaceIRenderable- Parameters:
graphic- The current graphics object onto which this instance will render its visual contents.- See Also:
-