addTrailMemberSimple

open fun addTrailMemberSimple(linkedEntity: SectorEntityToken, ID: Float, sprite: SpriteAPI, position: Vector2f, speed: Float, angle: Float, startSize: Float, endSize: Float, color: Color, opacity: Float, duration: Float, additive: Boolean, offsetVelocity: Vector2f)

Spawns a trail piece, which links up with other pieces with the same ID to form a smooth trail. This function has most of the functionality you need; should you want more configurability, use AddTrailMemberAdvanced instead

Parameters

linkedEntity

The 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: do *not* change this halfway through a trail, as that will split it into two trails

position

Starting position for this piece of trail

speed

The speed, in SU, this trail piece is moving at

angle

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

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

color

The color of this piece of trail. Can be changed in the middle of a trail, and will blend smoothly between pieces. Ignores alpha component entirely

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

duration

The duration of the trail, in seconds

additive

Whether this trail will use additive blending or not. Does not support being changed in the middle of a trail

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