private void Main_DrawBG(On.Terraria.Main.orig_DrawBG orig, Main self) { scaleTimer_BasedOnSineWave += 0.1f; rotationTimer_BasedOnSineWave += 0.01f; var screenBounds = new Vector2(Main.screenWidth, Main.screenHeight); var sinValueRot = (float)Math.Sin(rotationTimer_BasedOnSineWave); var sinValueScale = (float)Math.Sin(scaleTimer_BasedOnSineWave / 2); var inSettingsOrMPUI = Main.menuMode > 0 && Main.menuMode != 888 && Main.menuMode != 1010; if (Main.gameMenu) { Main.spriteBatch.End(); Main.spriteBatch.Begin(SpriteSortMode.Deferred, BlendState.AlphaBlend); Main.spriteBatch.SafeDraw(blackPixel, Vector2.Zero, null, Color.White, 0f, Vector2.Zero, new Vector2(Main.screenWidth, Main.screenHeight), SpriteEffects.None); Main.spriteBatch.SafeDraw(chad, new Vector2(150, Main.screenHeight - 30), null, Color.White, 0f, Vector2.Zero, 1f, SpriteEffects.None); if (Main.menuMode == 0 && Main.screenHeight > 800) { Main.spriteBatch.SafeDraw(slenderLogo, new Vector2(Main.screenWidth / 2, 220), null, Color.White, sinValueRot / 50, new Vector2(slenderLogo.Width / 2, slenderLogo.Height / 2), 1f + sinValueScale / 80, SpriteEffects.None); } } else { orig(self); } }
private static void Main_DrawBG(On.Terraria.Main.orig_DrawBG orig, Main self) { orig(self); if (Subworld.IsActive <Moon>()) { var earthTexture = MacrocosmMod.GetTexture("Assets/Earth"); var sb = Main.spriteBatch; sb.Draw(earthTexture, new Vector2(Main.screenWidth / 2, 200), null, Color.White, 0.4101524f, earthTexture.Size() / 2, 1f, default, 0f); // 0.4101524 is earth's axial tilt to radians