C# Класс Nez.Sprites.SpriteTrail

renders and fades a copy of the Sprite on the same Entity. minDistanceBetweenInstances determines how often a trail sprite is added.
Наследование: RenderableComponent, IUpdatable
Показать файл Открыть проект

Открытые свойства

Свойство Тип Описание
fadeDelay float
fadeDuration float
fadeToColor Color
initialColor Color
minDistanceBetweenInstances float

Открытые методы

Метод Описание
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

Приватные методы

Метод Описание
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

Описание методов

SpriteTrail() публичный Метод

public SpriteTrail ( Sprite sprite, int maxInstances = 15 ) : System
sprite Sprite
maxInstances int
Результат System

disableSpriteTrail() публичный Метод

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.
Результат void

enableSpriteTrail() публичный Метод

enables the SpriteTrail
public enableSpriteTrail ( ) : SpriteTrail
Результат SpriteTrail

render() публичный Метод

public render ( Graphics graphics, Camera camera ) : void
graphics Graphics
camera Camera
Результат void

Описание свойств

fadeDelay публичное свойство

delay before starting the color fade
public float fadeDelay
Результат float

fadeDuration публичное свойство

total duration of the fade from initialColor to fadeToColor
public float fadeDuration
Результат float

fadeToColor публичное свойство

final color that will be lerped to over the course of fadeDuration
public Color fadeToColor
Результат Color

initialColor публичное свойство

initial color of the trail instances
public Color initialColor
Результат Color

minDistanceBetweenInstances публичное свойство

how far does the Sprite have to move before a new instance is spawned
public float minDistanceBetweenInstances
Результат float