2019-05-31 01:32:25 -05:00
|
|
|
|
using Microsoft.Xna.Framework.Graphics;
|
2018-12-04 23:37:05 -06:00
|
|
|
|
using RecrownedAthenaeum.ContentSystem;
|
2019-01-30 07:45:55 -06:00
|
|
|
|
using RecrownedAthenaeum.Render;
|
2019-01-28 11:41:36 -06:00
|
|
|
|
using RecrownedAthenaeum.UI.BookSystem;
|
2018-12-04 23:37:05 -06:00
|
|
|
|
using RecrownedAthenaeum.UI.Modular.Modules;
|
|
|
|
|
using RecrownedAthenaeum.UI.Modular.Modules.Interactive;
|
2019-01-28 11:41:36 -06:00
|
|
|
|
using RecrownedAthenaeum.UI.SkinSystem;
|
2018-11-12 18:50:00 -06:00
|
|
|
|
|
2019-01-22 19:31:15 -06:00
|
|
|
|
namespace RhythmBullet.Screens.MainMenu
|
2018-11-12 18:50:00 -06:00
|
|
|
|
{
|
|
|
|
|
internal class MainPage : Page
|
|
|
|
|
{
|
2018-11-15 01:22:35 -06:00
|
|
|
|
Image title;
|
2018-11-22 01:12:40 -06:00
|
|
|
|
TextButton playButton;
|
|
|
|
|
TextButton quitButton;
|
|
|
|
|
|
2019-01-28 11:41:36 -06:00
|
|
|
|
internal MainPage() : base(0, 0)
|
|
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
|
2019-05-31 01:32:25 -05:00
|
|
|
|
protected override void Initialize(ContentManagerController assets, ISkin skin, BasicScissor scissorBox)
|
2018-11-12 18:50:00 -06:00
|
|
|
|
{
|
2018-11-15 01:22:35 -06:00
|
|
|
|
title = new Image(assets.Get<Texture2D>("title"));
|
2019-06-01 15:39:04 -05:00
|
|
|
|
AddModules(title);
|
2019-01-13 23:17:27 -06:00
|
|
|
|
|
2019-01-28 11:41:36 -06:00
|
|
|
|
SpriteFont font = assets.Get<SpriteFont>("gasalt_regular");
|
|
|
|
|
|
|
|
|
|
playButton = new TextButton("Play!", font, skin);
|
2019-06-01 15:39:04 -05:00
|
|
|
|
AddModules(playButton);
|
2019-01-28 11:41:36 -06:00
|
|
|
|
|
|
|
|
|
quitButton = new TextButton("Quit", font, skin);
|
2019-06-01 15:39:04 -05:00
|
|
|
|
AddModules(quitButton);
|
2019-05-31 01:32:25 -05:00
|
|
|
|
|
|
|
|
|
base.Initialize(assets, skin, scissorBox);
|
2018-11-15 01:22:35 -06:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public override void ApplySize(int width, int height)
|
|
|
|
|
{
|
2019-03-09 00:26:59 -06:00
|
|
|
|
base.ApplySize(width, height);
|
2019-03-01 23:30:43 -06:00
|
|
|
|
title.Scale = (width - 40) / title.texture.Width;
|
|
|
|
|
title.CenterOrigin();
|
2019-03-13 13:33:05 -05:00
|
|
|
|
title.CenterHorizontally();
|
|
|
|
|
title.CenterVertically();
|
2019-01-28 11:41:36 -06:00
|
|
|
|
|
2019-03-08 21:39:11 -06:00
|
|
|
|
|
2019-06-01 15:39:04 -05:00
|
|
|
|
playButton.Width = (int)(0.3f * title.Boundaries.Width);
|
|
|
|
|
playButton.Height = (int)(0.05f * title.Boundaries.Width);
|
2019-03-08 21:39:11 -06:00
|
|
|
|
playButton.CenterOrigin();
|
2019-03-13 13:33:05 -05:00
|
|
|
|
playButton.CenterHorizontally();
|
2019-06-01 15:39:04 -05:00
|
|
|
|
playButton.Y = (int)playButton.origin.Y + title.Boundaries.Y + title.Boundaries.Height + 60;
|
2019-03-08 21:39:11 -06:00
|
|
|
|
|
2019-06-01 15:39:04 -05:00
|
|
|
|
quitButton.Width = (int)(0.3f * title.Boundaries.Width);
|
|
|
|
|
quitButton.Height = (int)(0.05f * title.Boundaries.Width);
|
2019-03-08 21:39:11 -06:00
|
|
|
|
quitButton.CenterOrigin();
|
2019-03-13 13:33:05 -05:00
|
|
|
|
quitButton.CenterHorizontally();
|
2019-06-01 15:39:04 -05:00
|
|
|
|
quitButton.Y = (int)quitButton.origin.Y + playButton.Boundaries.Y + playButton.Boundaries.Height + 15;
|
2019-03-08 21:39:11 -06:00
|
|
|
|
|
2019-05-31 01:32:25 -05:00
|
|
|
|
|
|
|
|
|
base.ApplySize(width, height);
|
2018-11-12 19:54:33 -06:00
|
|
|
|
}
|
|
|
|
|
|
2019-05-31 01:32:25 -05:00
|
|
|
|
public override void Draw(ConsistentSpriteBatch batch)
|
2018-11-12 19:54:33 -06:00
|
|
|
|
{
|
2019-02-06 12:47:44 -06:00
|
|
|
|
base.Draw(batch);
|
2018-11-12 18:50:00 -06:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|