public override void PostDraw(SpriteBatch spriteBatch, Color lightColor) { Texture2D backdrop = GetTexture(AssetDirectory.VitricTile + "WindsRoomBackground"); Texture2D backdropGlow = GetTexture(AssetDirectory.VitricTile + "WindsRoomBackgroundGlow"); Vector2 pos = projectile.Center + new Vector2(-backdrop.Width / 2, -backdrop.Height + 8) - Main.screenPosition; LightingBufferRenderer.DrawWithLighting(pos, backdrop); spriteBatch.Draw(backdropGlow, pos, Color.White); Lighting.AddLight(projectile.Center + new Vector2(0, -400), new Vector3(1, 0.8f, 0.5f)); Lighting.AddLight(projectile.Center + new Vector2(-200, -200), new Vector3(1, 0.8f, 0.5f)); Lighting.AddLight(projectile.Center + new Vector2(200, -200), new Vector3(1, 0.8f, 0.5f)); Lighting.AddLight(projectile.Center + new Vector2(0, -32), new Vector3(1, 0.8f, 0.5f)); var lighting = Lighting.GetColor((int)projectile.Center.X / 16, (int)projectile.Center.Y / 16 - 6); Texture2D left = GetTexture(AssetDirectory.VitricTile + "WindsRoomOrnamentLeft"); Texture2D leftGlow = GetTexture(AssetDirectory.VitricTile + "WindsRoomOrnamentLeftGlow"); Vector2 posLeft = projectile.Center + new Vector2(-100 + (float)System.Math.Cos(Main.GameUpdateCount / 45f) * 2, -140 + (float)System.Math.Sin(Main.GameUpdateCount / 45f) * 6) - Main.screenPosition; spriteBatch.Draw(left, posLeft, null, lighting, (float)System.Math.Cos(Main.GameUpdateCount / 30f) * 0.05f, Vector2.Zero, 1, 0, 0); spriteBatch.Draw(leftGlow, posLeft, null, Color.White, (float)System.Math.Cos(Main.GameUpdateCount / 30f) * 0.05f, Vector2.Zero, 1, 0, 0); Texture2D right = GetTexture(AssetDirectory.VitricTile + "WindsRoomOrnamentRight"); Texture2D rightGlow = GetTexture(AssetDirectory.VitricTile + "WindsRoomOrnamentRightGlow"); Vector2 posRight = projectile.Center + new Vector2(0 - (float)System.Math.Cos(Main.GameUpdateCount / 30f + 5) * 2, -220 + (float)System.Math.Sin(Main.GameUpdateCount / 30f + 5) * 8) - Main.screenPosition; spriteBatch.Draw(right, posRight, null, lighting, (float)System.Math.Cos(Main.GameUpdateCount / 30f + 5) * 0.05f, Vector2.Zero, 1, 0, 0); spriteBatch.Draw(rightGlow, posRight, null, Color.White, (float)System.Math.Cos(Main.GameUpdateCount / 30f + 5) * 0.05f, Vector2.Zero, 1, 0, 0); }
public override void PostDraw(SpriteBatch spriteBatch, Color lightColor) { Vector2 pos = projectile.position + new Vector2(-608, -289) - Main.screenPosition; Texture2D backdrop = GetTexture(AssetDirectory.GlassMiniboss + "Backdrop"); Texture2D backdropGlow = GetTexture(AssetDirectory.GlassMiniboss + "BackdropGlow"); var frame = new Rectangle(0, (backdrop.Height / 3) * (int)(Main.GameUpdateCount / 8 % 3), backdrop.Width, backdrop.Height / 3); LightingBufferRenderer.DrawWithLighting(pos, backdrop, frame); spriteBatch.Draw(backdropGlow, pos, frame, Color.White); if (Main.rand.Next(3) == 0) { Dust.NewDustPerfect(projectile.Center + new Vector2(204 + Main.rand.Next(-10, 10), -94), DustType <Dusts.LavaSpark>(), -Vector2.UnitY.RotatedByRandom(0.1f).RotatedBy(Main.rand.NextBool() ? 0.6f : -0.6f) * Main.rand.NextFloat(1, 1.5f), 0, new Color(255, Main.rand.Next(150, 200), 80), 0.30f); } if (Main.rand.Next(3) == 0) { Dust.NewDustPerfect(projectile.Center + new Vector2(0 + Main.rand.Next(-10, 10), -240), DustType <Dusts.LavaSpark>(), -Vector2.UnitY.RotatedByRandom(0.1f).RotatedBy(Main.rand.NextBool() ? 0.6f : -0.6f) * Main.rand.NextFloat(1, 1.5f), 0, new Color(255, Main.rand.Next(150, 200), 80), 0.30f); } if (Main.rand.Next(5) == 0) { var d = Dust.NewDustPerfect(projectile.Center + new Vector2(-110 + Main.rand.Next(120), -130), DustType <Dusts.LavaSpark>(), -Vector2.UnitY.RotatedByRandom(0.1f) * Main.rand.NextFloat(0.1f, 0.6f), 0, new Color(255, 220, 120), Main.rand.NextFloat(0.2f)); d.noGravity = true; d = Dust.NewDustPerfect(projectile.Center + new Vector2(-250 + Main.rand.Next(80), -66), DustType <Dusts.LavaSpark>(), -Vector2.UnitY.RotatedByRandom(0.1f) * Main.rand.NextFloat(0.1f, 0.6f), 0, new Color(255, 220, 120), Main.rand.NextFloat(0.2f)); d.noGravity = true; var dist = Main.rand.Next(80); d = Dust.NewDustPerfect(projectile.Center + new Vector2(10 + dist, -130 + dist), DustType <Dusts.LavaSpark>(), -Vector2.UnitY.RotatedByRandom(0.1f) * Main.rand.NextFloat(0.1f, 0.6f), 0, new Color(255, 220, 120), Main.rand.NextFloat(0.2f)); d.noGravity = true; dist = Main.rand.Next(60); d = Dust.NewDustPerfect(projectile.Center + new Vector2(-110 + dist, -196 - dist), DustType <Dusts.LavaSpark>(), -Vector2.UnitY.RotatedByRandom(0.1f) * Main.rand.NextFloat(0.1f, 0.6f), 0, new Color(255, 220, 120), Main.rand.NextFloat(0.2f)); d.noGravity = true; } for (int k = 0; k < 5; k++) { Lighting.AddLight(projectile.Center + new Vector2(200, -280 + k * 35), new Vector3(1, 0.8f, 0.5f)); } Lighting.AddLight(projectile.Center + new Vector2(-20, -280), new Vector3(1, 0.8f, 0.5f) * 1.1f); Lighting.AddLight(projectile.Center + new Vector2(-80, -220), new Vector3(1, 0.8f, 0.5f) * 1.1f); Lighting.AddLight(projectile.Center + new Vector2(40, -90), new Vector3(1, 0.8f, 0.5f) * 1.1f); Lighting.AddLight(projectile.Center + new Vector2(-260, -80), new Vector3(1, 0.8f, 0.5f) * 0.8f); for (int k = 0; k < 3; k++) { Lighting.AddLight(projectile.Center + new Vector2(130, 200 + k * 35), new Vector3(1, 0.8f, 0.5f) * 1.1f); Lighting.AddLight(projectile.Center + new Vector2(-130, 200 + k * 35), new Vector3(1, 0.8f, 0.5f) * 1.1f); } }
public override void PostDraw(SpriteBatch spriteBatch, Color lightColor) { Tile t = Parent; if (t != null && t.frameX > 0 && variantCount > 0) { Texture2D tex = Main.tileTexture[t.type]; Rectangle frame = tex.Frame(variantCount, 1, t.frameX - 1); Vector2 pos = ((projectile.position - Main.screenPosition) + DrawOffset) - new Vector2(frame.Width * 0.5f, frame.Height); LightingBufferRenderer.DrawWithLighting(pos, tex, frame, DrawColor); } }
public void Draw() { if (Helper.OnScreen(pos - Main.screenPosition, tex.Size())) { LightingBufferRenderer.DrawWithLighting(pos - Main.screenPosition, tex, Color.White * fadeTime); } if (fade) { fadeTime -= 0.025f; } else { fadeTime += 0.025f; } fadeTime = MathHelper.Clamp(fadeTime, 0.01f, 1); }