Class BaseCustomEntityPlugin
java.lang.Object
com.fs.starfarer.api.impl.campaign.BaseCustomEntityPlugin
- All Implemented Interfaces:
CustomCampaignEntityPlugin
- Direct Known Subclasses:
AbyssalLightEntityPlugin
,BaseCampaignObjectivePlugin
,CargoPodsEntityPlugin
,CryosleeperEntityPlugin
,DerelictShipEntityPlugin
,ExampleCustomEntityPlugin
,ExplosionEntityPlugin
,FusionLampEntityPlugin
,GateEntityPlugin
,GateHaulerEntityPlugin
,GenericProbeEntityPlugin
,HiddenCacheEntityPlugin
,SlipstreamEntityPlugin
,SlipstreamEntityPlugin2
,SupplyCacheEntityPlugin
,TurbulenceEntityPlugin
,WarningBeaconEntityPlugin
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
advance
(float amount) void
appendToCampaignTooltip
(TooltipMakerAPI tooltip, SectorEntityToken.VisibilityLevel level) void
createMapTooltip
(TooltipMakerAPI tooltip, boolean expanded) float
float
How far away from the viewport the center of this entity can be before it stops being rendered.boolean
void
init
(SectorEntityToken entity, Object pluginParams) boolean
void
render
(CampaignEngineLayers layer, ViewportAPI viewport) Should only render for specified layer.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface com.fs.starfarer.api.campaign.CustomCampaignEntityPlugin
isRenderWhenViewportAlphaMultIsZero
-
Field Details
-
entity
-
-
Constructor Details
-
BaseCustomEntityPlugin
public BaseCustomEntityPlugin()
-
-
Method Details
-
init
- Specified by:
init
in interfaceCustomCampaignEntityPlugin
-
advance
public void advance(float amount) - Specified by:
advance
in interfaceCustomCampaignEntityPlugin
- Parameters:
amount
- in seconds. Use SectorAPI.getClock() to figure out how many campaign days that is.
-
getRenderRange
public float getRenderRange()Description copied from interface:CustomCampaignEntityPlugin
How far away from the viewport the center of this entity can be before it stops being rendered. Should at least be the radius of the entity; sometimes more may be necessary depending on the visual effect desired.- Specified by:
getRenderRange
in interfaceCustomCampaignEntityPlugin
- Returns:
-
render
Description copied from interface:CustomCampaignEntityPlugin
Should only render for specified layer. Will be called once per each layer, per frame. Needs to respect viewport.getAlphaMult() - i.e. use that alpha value for rendering. Needs to render at the entity's location - there's no translation before this method call. If a sprite is specified, it will be rendered in the bottommost layer of the layers this entity renders for. This method will be called after the sprite has rendered.- Specified by:
render
in interfaceCustomCampaignEntityPlugin
-
hasCustomMapTooltip
public boolean hasCustomMapTooltip()- Specified by:
hasCustomMapTooltip
in interfaceCustomCampaignEntityPlugin
-
getMapTooltipWidth
public float getMapTooltipWidth()- Specified by:
getMapTooltipWidth
in interfaceCustomCampaignEntityPlugin
-
isMapTooltipExpandable
public boolean isMapTooltipExpandable()- Specified by:
isMapTooltipExpandable
in interfaceCustomCampaignEntityPlugin
-
createMapTooltip
- Specified by:
createMapTooltip
in interfaceCustomCampaignEntityPlugin
-
appendToCampaignTooltip
public void appendToCampaignTooltip(TooltipMakerAPI tooltip, SectorEntityToken.VisibilityLevel level) - Specified by:
appendToCampaignTooltip
in interfaceCustomCampaignEntityPlugin
-