T
- The base type of object the renderer will be drawing
(CombatEntityAPI
in combat or SectorEntityToken
on
the campaign map).P
- The type of the player object (ShipAPI
in combat or
CampaignFleetAPI
on the campaign map).
public interface BaseRenderer<T,P>
CombatRenderer
or
CampaignRenderer
convenience interface.Modifier and Type | Method and Description |
---|---|
void |
init(CommonRadar<T> 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(P player,
float amount,
boolean isUpdateFrame)
Called every frame to tell your component to render.
|
void reloadSettings(org.json.JSONObject settings) throws org.json.JSONException
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!
settings
- The contents of the settings file linked to in the radar
plugin CSV.
org.json.JSONException
void init(CommonRadar<T> radar)
radar
- The master radar object; you should keep track of this as
many of its properties can change.
void render(P player, float amount, boolean isUpdateFrame)
CommonRadar.resetView()
at the end of this
method.
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.