addTrailMemberAnimated

open fun addTrailMemberAnimated(linkedEntity: SectorEntityToken, ID: Float, sprite: SpriteAPI, position: Vector2f, startSpeed: Float, endSpeed: Float, angle: Float, startAngularVelocity: Float, endAngularVelocity: Float, startSize: Float, endSize: Float, startColor: Color, endColor: Color, opacity: Float, inDuration: Float, mainDuration: Float, outDuration: Float, blendModeSRC: Int, blendModeDEST: Int, textureLoopLength: Float, textureScrollSpeed: Float, offsetVelocity: Vector2f, locationAPICulling: Boolean, locationAPI: LocationAPI)

Spawns a trail piece, which links up with other pieces with the same ID to form a smooth trail. This function is similar to the Advanced function, but allows the trail to change its texture each time a new member is added. It will always use the texture of the most recently-added member. If the texture is not supposed to be animated, do NOT use this function: it runs notably slower.

Parameters

linkedEntity

The campaign entity this trail is attached to, used for cutting trails. Can be Null, but that should really only be done in weird, edge-case scenarios

ID

The ID for this specific trail. Preferably get this from getUniqueID, but it's not required: just expect very weird results if you don't

sprite

Which sprite to draw for this trail: if changed mid-trail, the entire trail uses the new sprite.

position

Starting position for this piece of trail

startSpeed

The starting speed, in SU, this trail piece is moving at. The trail piece smoothly transitions from its startSpeed to its endSpeed over its duration

endSpeed

The ending speed, in SU, this trail piece is moving at. The trail piece smoothly transitions from its startSpeed to its endSpeed over its duration

angle

Which angle this piece of trail has in degrees; determines which direction it moves, and which direction its size is measured over

startAngularVelocity

The angular velocity this trail piece has when spawned. The angular velocity of a trail piece smoothly transitions from startAngularVelocity to endAngularVelocity over its duration

endAngularVelocity

The angular velocity this trail piece has just before disappearing. The angular velocity of a trail piece smoothly transitions from startAngularVelocity to endAngularVelocity over its duration

startSize

The starting size (or rather width) this piece of trail has. Measured in SU. A trail smoothly transitions from its startSize to its endSize over its duration

endSize

The ending size (or rather width) this trail piece has. Measured in SU. A trail smoothly transitions from its startSize to its endSize over its duration

startColor

The color this piece of trail has when spawned. Can be changed in the middle of a trail, and will blend smoothly between pieces. Ignores alpha component entirely. Each trail piece smoothly transitions from startColor to endColor over its duration

endColor

The color this piece of trail has just before disappearing. Can be changed in the middle of a trail, and will blend smoothly between pieces. Ignores alpha component entirely. Each trail piece smoothly transitions from startColor to endColor over its duration

opacity

The starting opacity of this piece of trail. Is a value between 0f and 1f. The opacity gradually approaches 0f over the trail's duration

inDuration

How long this trail spends "fading in"; for this many seconds, the opacity of the trail piece steadily increases until reaching "opacity". A trail's total duration is inDuration + mainDuration + outDuration

mainDuration

How long a trail uses its maximum opacity. A trail's total duration is inDuration + mainDuration + outDuration

outDuration

How long a trail spends "fading out"; over this many seconds at the end of the trail's duration, its opacity goes from "opacity" to 0f. A trail's total duration is inDuration + mainDuration + outDuration

blendModeSRC

Which SRD openGL blend mode to use for the trail. If you are unsure of what this means, just put it as GL_SRC_ALPHA

blendModeDEST

Which DEST openGL blend mode to use for the trail. If you are unsure of what this means, put it as GL_ONE_MINUS_SRC_ALPHA for normal blending and GL_ONE for additive blending

textureLoopLength

How many SU it takes for the texture to loop. Should preferably be non-zero. If the trail is not supposed to loop, put this as -1f

textureScrollSpeed

How fast, and in which direction, the texture scrolls over the trail. Defined so that 1000 means scrolling the entire texture length once per second, and 2000 means scrolling the entire texture length twice per second

offsetVelocity

The offset velocity of the trail; this is an additional velocity that is unaffected by rotation and facing, and will never change over the trail's lifetime

locationAPICulling

If true, the trail is removed from memory as soon as the player fleet leaves the location the trail is in. If false, the trail is only "frozen" when the player leaves

locationAPI

Which locationAPI this trail is in; should ideally be in the same as the location the linkedEntity is in.