C# Class Nez.Sprites.SpriteTrail

renders and fades a copy of the Sprite on the same Entity. minDistanceBetweenInstances determines how often a trail sprite is added.
Inheritance: RenderableComponent, IUpdatable
Afficher le fichier Open project: prime31/Nez

Méthodes publiques

Свойство Type Description
fadeDelay float
fadeDuration float
fadeToColor Color
initialColor Color
minDistanceBetweenInstances float

Méthodes publiques

Méthode Description
SpriteTrail ( Sprite sprite, int maxInstances = 15 ) : System
disableSpriteTrail ( bool completeCurrentTrail = true ) : void

disables the SpriteTrail optionally waiting for the current trail to fade out first

enableSpriteTrail ( ) : SpriteTrail

enables the SpriteTrail

render ( Graphics graphics, Camera camera ) : void

Private Methods

Méthode Description
IUpdatable ( ) : void
spawnInstance ( ) : void

stores the last position for distance calculations and spawns a new trail instance if there is one available in the stack

Method Details

SpriteTrail() public méthode

public SpriteTrail ( Sprite sprite, int maxInstances = 15 ) : System
sprite Sprite
maxInstances int
Résultat System

disableSpriteTrail() public méthode

disables the SpriteTrail optionally waiting for the current trail to fade out first
public disableSpriteTrail ( bool completeCurrentTrail = true ) : void
completeCurrentTrail bool If set to true complete current trail.
Résultat void

enableSpriteTrail() public méthode

enables the SpriteTrail
public enableSpriteTrail ( ) : SpriteTrail
Résultat SpriteTrail

render() public méthode

public render ( Graphics graphics, Camera camera ) : void
graphics Graphics
camera Camera
Résultat void

Property Details

fadeDelay public_oe property

delay before starting the color fade
public float fadeDelay
Résultat float

fadeDuration public_oe property

total duration of the fade from initialColor to fadeToColor
public float fadeDuration
Résultat float

fadeToColor public_oe property

final color that will be lerped to over the course of fadeDuration
public Color fadeToColor
Résultat Color

initialColor public_oe property

initial color of the trail instances
public Color initialColor
Résultat Color

minDistanceBetweenInstances public_oe property

how far does the Sprite have to move before a new instance is spawned
public float minDistanceBetweenInstances
Résultat float