Interface ScreenEffectLayers


public interface ScreenEffectLayers
The order screen effects are drawn in, like layers in an image editor: the first layer is drawn first, straight over the game, and each later one processes the image the layers before it produced. So a blur above a vignette blurs the vignette's edge too; below it, the edge stays sharp.

Every registered effect has a layer, whether it's on or not. The order starts out sorted by priority (then registration order), and stays as rearranged once changed, from here or by a player in the effects screen, which remembers it. Scopes come first: all WORLD effects are drawn before any SCREEN effect, whatever their layers.

Only use it from the render thread.

  • Method Details

    • order

      List<ScreenEffect> order()
      Every effect, from the bottom layer (drawn first) to the top (drawn last).
    • visible

      The effects in a scope that are drawn this frame, bottom to top.
    • indexOf

      int indexOf(ScreenEffect effect)
      The effect's layer: 0 is the bottom.
    • moveTo

      void moveTo(ScreenEffect effect, int index)
      Moves an effect to a layer, 0 being the bottom; the index is clamped.
    • moveUp

      void moveUp(ScreenEffect effect)
      Moves it one layer up (drawn later), past the next effect of its own scope.
    • moveDown

      void moveDown(ScreenEffect effect)
      Moves it one layer down (drawn earlier), past the previous effect of its own scope.
    • bringToTop

      default void bringToTop(ScreenEffect effect)
    • sendToBottom

      default void sendToBottom(ScreenEffect effect)
    • isCustomized

      boolean isCustomized()
      Whether the order was rearranged, rather than following priorities.
    • resetOrder

      void resetOrder()
      Sorts the layers by priority again.