public class NullRenderer extends java.lang.Object implements BaseRenderer
Can be set as a renderer by a mod to completely disable a vanilla renderer. For example: set ShipRenderer's script to NullRenderer if you are making your own system to draw ships and don't want to use ShipRenderer as its ID for some reason.
Constructor and Description |
---|
NullRenderer() |
Modifier and Type | Method and Description |
---|---|
void |
init(CommonRadar radar)
Called on the first frame before rendering begins.
|
void |
reloadSettings(org.json.JSONObject settings)
Called when the game first loads or when
RadarModPlugin#reloadSettings() is called. |
void |
render(java.lang.Object player,
float amount,
boolean isUpdateFrame)
Called every frame to tell your component to render.
|
public void reloadSettings(org.json.JSONObject settings) throws org.json.JSONException
BaseRenderer
RadarModPlugin#reloadSettings()
is called. You should set up
static variables such as colors here.
IMPORTANT: this method is called on a temporary object during loading. Any variables you set in here must be static or they won't be retained!
reloadSettings
in interface BaseRenderer
settings
- The contents of the settings file linked to in the radar
plugin CSV.
org.json.JSONException
public void init(CommonRadar radar)
BaseRenderer
init
in interface BaseRenderer
radar
- The master radar object; you should keep track of this as
many of its properties can change.
public void render(java.lang.Object player, float amount, boolean isUpdateFrame)
BaseRenderer
CommonRadar.resetView()
at the end of this
method.
render
in interface BaseRenderer
player
- The player's object; also the center of the radar.
Will never be null.amount
- How long since the last frame, useful for animated
radar elements.isUpdateFrame
- Whether the radar should update components this
frame, used so the radar can run at a lower
framerate than Starsector.