Class EffectLayer

java.lang.Object
games.stendhal.client.LayerRenderer
games.stendhal.client.gui.EffectLayer
Direct Known Subclasses:
BlackenScreenEffect, LightningEffect

public abstract class EffectLayer extends LayerRenderer
A renderer for map wide effects. These effects are normally temporary and they are automatically removed as soon as isExpired() returns true.
  • Constructor Details

    • EffectLayer

      public EffectLayer(int duration)
      Create an EffectLayer for specified effect duration.
      Parameters:
      duration - effect duration in milliseconds
  • Method Details

    • setTileset

      public void setTileset(Tileset tileset)
      Description copied from class: LayerRenderer
      Set the tiles used for rendering.
      Specified by:
      setTileset in class LayerRenderer
      Parameters:
      tileset - tile set
    • draw

      public void draw(Graphics g, int x, int y, int w, int h)
      Description copied from class: LayerRenderer
      Render the layer.
      Specified by:
      draw in class LayerRenderer
      Parameters:
      g - The graphics to draw to
      x - starting x coordinate in world units
      y - starting y coordinate in world units
      w - width in world units
      h - height in world units
    • isExpired

      public boolean isExpired()
      Check if the effect is old enough to have expired so that it should be removed.
      Returns:
      true if the effect has expired, otherwise false