public void EmitParticleWithDisplayEntity(DisplayEntity displayEntity) { foreach (Particle particle in particles) { if (!particle.Active) { particle.ActivateWithDisplayEntity(displayEntity, particleLifetime, true, true, 0.6f, 0.7f); break; } } }
public void ActivateWithDisplayEntity(DisplayEntity displayEntity, float lifetime, bool fadeAway, bool alphaAway, float initialOpacity, float initialAlpha) { this.Active = true; lifeTimer.SetDelay(lifetime); this.fadeAway = fadeAway; this.alphaAway = alphaAway; this.initialOpacity = initialOpacity; this.initialAlpha = initialAlpha; // Extract drawing information from the display entity SpriteSheet = displayEntity.SpriteSheet; SourceRect = displayEntity.SourceRect; Position = displayEntity.Position; Scale = displayEntity.Scale; Color = displayEntity.Color; Rotation = displayEntity.Rotation; SpriteEffects = displayEntity.SpriteEffects; LayerDepth = displayEntity.LayerDepth + 0.001f; Width = SourceRect.Width; Height = SourceRect.Height; origin = new Vector2(Width * 0.5f, Height * 0.5f); }
public void ActivateWithDisplayEntity(DisplayEntity displayEntity, float lifetime, bool fadeAway, bool alphaAway, float initialOpacity, float initialAlpha) { this.Active = true; lifeTimer.SetDelay(lifetime); this.fadeAway = fadeAway; this.alphaAway = alphaAway; this.initialOpacity = initialOpacity; this.initialAlpha = initialAlpha; // Extract drawing information from the display entity SpriteSheet = displayEntity.SpriteSheet; SourceRect = displayEntity.SourceRect; Position = displayEntity.Position; Scale = displayEntity.Scale; Color = displayEntity.Color; Rotation = displayEntity.Rotation; SpriteEffects = displayEntity.SpriteEffects; LayerDepth = displayEntity.LayerDepth +0.001f; Width = SourceRect.Width; Height = SourceRect.Height; origin = new Vector2(Width * 0.5f, Height * 0.5f); }
public void ActivateWithDisplayEntity(DisplayEntity displayEntity, float lifetime, bool fadeAway, bool alphaAway) { ActivateWithDisplayEntity(displayEntity, lifetime, fadeAway, alphaAway, 1f, 1f); }
public void ActivateWithDisplayEntity(DisplayEntity displayEntity, float lifetime) { ActivateWithDisplayEntity(displayEntity, lifetime, false, false, 1f, 1f); }