Class DistortionShader

java.lang.Object
org.dark.shaders.distortion.DistortionShader
All Implemented Interfaces:
ShaderAPI

public class DistortionShader extends Object implements ShaderAPI
This implementation of ShaderAPI contains the Starsector General Distortion Engine. Do not modify.

Since:
Alpha 1.1
  • Nested Class Summary

    Nested classes/interfaces inherited from interface org.dark.shaders.util.ShaderAPI

    ShaderAPI.RenderOrder
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    static void
    Adds a distortion object to the rendering list.
    void
    advance(float amount, List<com.fs.starfarer.api.input.InputEventAPI> events)
    This method will be called for multiple shaders in a particular order, dictated by getRenderOrder().
    void
    This method is called when the current instance is destroyed, such as when the settings are reloaded.
    com.fs.starfarer.api.combat.CombatEngineLayers
    This method determines the combat rendering layer in which the shader is run.
    This method determines the order in which the shader is inserted in the rendering queue.
    void
    This method is called at the beginning of each combat instance.
    boolean
    This method returns whether this shader is rendered within a combat layer or not.
    boolean
    This method returns whether this shader is enabled or not.
    static void
    Forcibly removes a distortion object from the rendering list.
    void
    renderInScreenCoords(com.fs.starfarer.api.combat.ViewportAPI viewport)
    This method is called before advance() and before the UI is drawn.
    void
    renderInWorldCoords(com.fs.starfarer.api.combat.ViewportAPI viewport)
    This method is called before advance() and before the UI is drawn.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • DistortionShader

      public DistortionShader()
  • Method Details

    • addDistortion

      public static void addDistortion(DistortionAPI distortion)
      Adds a distortion object to the rendering list. This function will do nothing if the distortion shader is not enabled.

      Does not check for duplicates.

      Parameters:
      distortion - The distortion object to add.

      Since:
      Alpha 1.1
    • removeDistortion

      public static void removeDistortion(DistortionAPI distortion)
      Forcibly removes a distortion object from the rendering list. This function will do nothing if the distortion shader is not enabled.

      Parameters:
      distortion - The distortion object to remove.

      Since:
      Beta 1.03
    • advance

      public void advance(float amount, List<com.fs.starfarer.api.input.InputEventAPI> events)
      Description copied from interface: ShaderAPI
      This method will be called for multiple shaders in a particular order, dictated by getRenderOrder(). Make sure that data updates and bookkeeping are done within an advance() method.

      Specified by:
      advance in interface ShaderAPI
      Parameters:
      amount - The amount of time since the last frame.
      events - A list of general input events.
    • destroy

      public void destroy()
      Description copied from interface: ShaderAPI
      This method is called when the current instance is destroyed, such as when the settings are reloaded.

      Specified by:
      destroy in interface ShaderAPI
    • getRenderOrder

      public ShaderAPI.RenderOrder getRenderOrder()
      Description copied from interface: ShaderAPI
      This method determines the order in which the shader is inserted in the rendering queue. This method is read every frame. Note that this is only used if isCombat() is false.

      Specified by:
      getRenderOrder in interface ShaderAPI
      Returns:
      The order by which the shader will render.
    • initCombat

      public void initCombat()
      Description copied from interface: ShaderAPI
      This method is called at the beginning of each combat instance.
      Specified by:
      initCombat in interface ShaderAPI
    • isEnabled

      public boolean isEnabled()
      Description copied from interface: ShaderAPI
      This method returns whether this shader is enabled or not.

      Specified by:
      isEnabled in interface ShaderAPI
      Returns:
      Whether this shader is enabled or not.

    • renderInScreenCoords

      public void renderInScreenCoords(com.fs.starfarer.api.combat.ViewportAPI viewport)
      Description copied from interface: ShaderAPI
      This method is called before advance() and before the UI is drawn. Warning: only called if isCombat() is false!

      Specified by:
      renderInScreenCoords in interface ShaderAPI
      Parameters:
      viewport - The screen-based coordinates to draw with.
    • renderInWorldCoords

      public void renderInWorldCoords(com.fs.starfarer.api.combat.ViewportAPI viewport)
      Description copied from interface: ShaderAPI
      This method is called before advance() and before the UI is drawn.

      Specified by:
      renderInWorldCoords in interface ShaderAPI
      Parameters:
      viewport - The world-based coordinates to draw with.
    • getCombatLayer

      public com.fs.starfarer.api.combat.CombatEngineLayers getCombatLayer()
      Description copied from interface: ShaderAPI
      This method determines the combat rendering layer in which the shader is run. This method is read every frame. Note that this is only used if isCombat() is true.

      Specified by:
      getCombatLayer in interface ShaderAPI
      Returns:
      The layer in which the shader will render.

    • isCombat

      public boolean isCombat()
      Description copied from interface: ShaderAPI
      This method returns whether this shader is rendered within a combat layer or not.

      Specified by:
      isCombat in interface ShaderAPI
      Returns:
      Whether this shader is rendered within a combat layer.