public override bool PreDraw(SpriteBatch spriteBatch, Color lightColor) { float fadeOutFrames = 30; float brightness = projectile.timeLeft > fadeOutFrames ? 1 : projectile.timeLeft / fadeOutFrames; scHelper.Draw(spriteBatch, Color.White * brightness); return(false); }
// for layering purposes, this needs to be done manually // Called from TerrarianEnt.PreDraw public void SubPreDraw(SpriteBatch spriteBatch, Color lightColor) { // this is a lot of sprite drawing // lifted from ExampleMod's ExampleBullet int attackFrame = animationFrame - targetStartFrame; if (targetStartFrame != default && attackFrame > windupFrames) { for (int k = 0; k < blurHelper.BlurLength; k++) { if (!blurHelper.GetBlurPosAndColor(k, lightColor, out Vector2 blurPos, out Color blurColor)) { break; } scHelper.positionOverride = blurPos; scHelper.Draw(spriteBatch, blurColor * 0.25f); } } scHelper.positionOverride = null; scHelper.Draw(spriteBatch, lightColor); }
public override bool PreDraw(SpriteBatch spriteBatch, Color lightColor) { lightColor = Color.White * 0.75f; int i; for (i = 0; i < subProjectiles.Count; i++) { if (subProjectiles[i].projectile.position.Y > projectile.position.Y + 96) { break; } subProjectiles[i].SubPreDraw(spriteBatch, lightColor); } scHelper.Draw(spriteBatch, lightColor); for (; i < subProjectiles.Count; i++) { subProjectiles[i].SubPreDraw(spriteBatch, lightColor); } return(false); }