rhythmbullet/RhythmBullet/Screens/MainMenu/MainPage.cs

54 lines
1.5 KiB
C#
Raw Normal View History

2019-01-28 17:41:36 +00:00
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
using RecrownedAthenaeum.ContentSystem;
2019-01-30 13:45:55 +00:00
using RecrownedAthenaeum.Render;
2019-01-28 17:41:36 +00:00
using RecrownedAthenaeum.UI.BookSystem;
using RecrownedAthenaeum.UI.Modular.Modules;
using RecrownedAthenaeum.UI.Modular.Modules.Interactive;
2019-01-28 17:41:36 +00:00
using RecrownedAthenaeum.UI.SkinSystem;
using RecrownedAthenaeum.UI.SkinSystem.Definitions;
2018-11-13 00:50:00 +00:00
2019-01-23 01:31:15 +00:00
namespace RhythmBullet.Screens.MainMenu
2018-11-13 00:50:00 +00:00
{
internal class MainPage : Page
{
2018-11-15 07:22:35 +00:00
Image title;
2018-11-22 07:12:40 +00:00
TextButton playButton;
TextButton quitButton;
2019-01-28 17:41:36 +00:00
internal MainPage() : base(0, 0)
{
Debugging = true;
2019-01-28 17:41:36 +00:00
}
protected override void Initialize(ContentManagerController assets, ISkin skin)
2018-11-13 00:50:00 +00:00
{
2018-11-15 07:22:35 +00:00
title = new Image(assets.Get<Texture2D>("title"));
AddModule(title);
2019-01-28 17:41:36 +00:00
SpriteFont font = assets.Get<SpriteFont>("gasalt_regular");
playButton = new TextButton("Play!", font, skin);
AddModule(playButton);
quitButton = new TextButton("Quit", font, skin);
AddModule(quitButton);
2018-11-15 07:22:35 +00:00
}
public override void ApplySize(int width, int height)
{
2019-03-02 05:30:43 +00:00
title.Scale = (width - 40) / title.texture.Width;
title.CenterOrigin();
title.bounds.X = width / 2;
title.bounds.Y = height / 2;
2019-01-28 17:41:36 +00:00
2018-11-15 07:22:35 +00:00
base.ApplySize(width, height);
2018-11-13 01:54:33 +00:00
}
public override void Draw(SpriteBatch batch)
{
2019-02-06 18:47:44 +00:00
base.Draw(batch);
2018-11-13 00:50:00 +00:00
}
}
}