Package org.dark.shaders.lens
Class LensShader
java.lang.Object
org.dark.shaders.lens.LensShader
- All Implemented Interfaces:
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
FieldsModifier and TypeFieldDescriptionstatic final Comparator<com.fs.starfarer.api.combat.CombatEntityAPI> -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidThis method will be called for multiple shaders in a particular order, dictated by getRenderOrder().voiddestroy()This method is called when the current instance is destroyed, such as when the settings are reloaded.com.fs.starfarer.api.combat.CombatEngineLayersThis 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.voidThis method is called at the beginning of each combat instance.booleanisCombat()This method returns whether this shader is rendered within a combat layer or not.booleanThis method returns whether this shader is enabled or not.voidrenderInScreenCoords(com.fs.starfarer.api.combat.ViewportAPI viewport) This method is called before advance() and before the UI is drawn.voidrenderInWorldCoords(com.fs.starfarer.api.combat.ViewportAPI viewport) This method is called before advance() and before the UI is drawn.
-
Field Details
-
ENTITYSIZE
-
-
Constructor Details
-
LensShader
public LensShader()
-
-
Method Details
-
advance
Description copied from interface:ShaderAPIThis 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. -
destroy
public void destroy()Description copied from interface:ShaderAPIThis method is called when the current instance is destroyed, such as when the settings are reloaded. -
getRenderOrder
Description copied from interface:ShaderAPIThis 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:
getRenderOrderin interfaceShaderAPI- Returns:
- The order by which the shader will render.
-
initCombat
public void initCombat()Description copied from interface:ShaderAPIThis method is called at the beginning of each combat instance.- Specified by:
initCombatin interfaceShaderAPI
-
isEnabled
public boolean isEnabled()Description copied from interface:ShaderAPIThis method returns whether this shader is enabled or not. -
renderInScreenCoords
public void renderInScreenCoords(com.fs.starfarer.api.combat.ViewportAPI viewport) Description copied from interface:ShaderAPIThis method is called before advance() and before the UI is drawn. Warning: only called if isCombat() is false!- Specified by:
renderInScreenCoordsin interfaceShaderAPI- Parameters:
viewport- The screen-based coordinates to draw with.
-
renderInWorldCoords
public void renderInWorldCoords(com.fs.starfarer.api.combat.ViewportAPI viewport) Description copied from interface:ShaderAPIThis method is called before advance() and before the UI is drawn.- Specified by:
renderInWorldCoordsin interfaceShaderAPI- Parameters:
viewport- The world-based coordinates to draw with.
-
getCombatLayer
public com.fs.starfarer.api.combat.CombatEngineLayers getCombatLayer()Description copied from interface:ShaderAPIThis 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:
getCombatLayerin interfaceShaderAPI- Returns:
- The layer in which the shader will render.
-
isCombat
public boolean isCombat()Description copied from interface:ShaderAPIThis method returns whether this shader is rendered within a combat layer or not.
-