rhythmbullet/RhythmBullet/Screens/MainMenu/MainPage.cs

32 lines
929 B
C#

using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
using RhythmBullet.UI.Book;
using RhythmBullet.Utilities.ContentSystem;
using RhythmBullet.Utilities.UI.Modular.Modules;
namespace RhythmBullet.Screens.MainMenu
{
internal class MainPage : Page
{
Image title;
internal MainPage(ContentManagerController assets) : base(0, 0)
{
title = new Image(assets.Get<Texture2D>("title"));
AddModule(title);
}
public override void ApplySize(int width, int height)
{
title.Scale = (width - 40) / title.Texture.Width;
title.bounds.X = (int)((width - title.bounds.Width) / 2f);
title.bounds.Y = (int)((height - title.bounds.Height) / 2f);
base.ApplySize(width, height);
}
public override void Draw(SpriteBatch batch)
{
base.Draw(batch);
}
}
}