Class LensShader

java.lang.Object
org.dark.shaders.lens.LensShader
All Implemented Interfaces:
ShaderAPI

public class LensShader extends Object implements ShaderAPI
Example lensing shader. Will be expanded to be usable as a ship system, later.

  • Nested Class Summary

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

    ShaderAPI.RenderOrder
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final Comparator<com.fs.starfarer.api.combat.CombatEntityAPI>
     
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    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.
    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
  • Field Details

    • ENTITYSIZE

      public static final Comparator<com.fs.starfarer.api.combat.CombatEntityAPI> ENTITYSIZE
  • Constructor Details

    • LensShader

      public LensShader()
  • Method Details

    • 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.