31 lines
1.4 KiB
C#
31 lines
1.4 KiB
C#
using Microsoft.Xna.Framework;
|
|
using Microsoft.Xna.Framework.Graphics;
|
|
using ReLogic.Content;
|
|
using Terraria;
|
|
using Terraria.ModLoader;
|
|
|
|
namespace CalamityMod.MainMenu
|
|
{
|
|
public class CalamityMainMenu : ModMenu
|
|
{
|
|
public override string DisplayName => "Calamity Style";
|
|
|
|
public override Asset<Texture2D> Logo => ModContent.Request<Texture2D>("CalamityMod/MainMenu/Logo");
|
|
public override Asset<Texture2D> SunTexture => ModContent.Request<Texture2D>("CalamityMod/Backgrounds/BlankPixel");
|
|
public override Asset<Texture2D> MoonTexture => ModContent.Request<Texture2D>("CalamityMod/Backgrounds/BlankPixel");
|
|
|
|
public override ModSurfaceBackgroundStyle MenuBackgroundStyle => ModContent.GetInstance<NullSurfaceBackground>();
|
|
|
|
// Before drawing the logo, draw the entire Calamity background. This way, the typical parallax background is skipped entirely.
|
|
public override bool PreDrawLogo(SpriteBatch spriteBatch, ref Vector2 logoDrawCenter, ref float logoRotation, ref float logoScale, ref Color drawColor)
|
|
{
|
|
Texture2D texture = ModContent.Request<Texture2D>("CalamityMod/MainMenu/MenuBackground").Value;
|
|
spriteBatch.Draw(texture, new Vector2(0f, 0f), null, Color.White, 0f, Vector2.Zero, (float)Main.screenWidth / texture.Width, SpriteEffects.None, 0f);
|
|
|
|
// TODO -- Draw plenty of cinders!
|
|
|
|
return true;
|
|
}
|
|
}
|
|
}
|