2019-01-28 17:41:36 +00:00
|
|
|
|
using Microsoft.Xna.Framework;
|
|
|
|
|
using Microsoft.Xna.Framework.Graphics;
|
2018-12-05 05:37:05 +00:00
|
|
|
|
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;
|
2018-12-05 05:37:05 +00:00
|
|
|
|
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;
|
2019-03-08 05:46:51 +00:00
|
|
|
|
using System;
|
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)
|
|
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
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-14 05:17:27 +00:00
|
|
|
|
|
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
|
|
|
|
|
2019-03-09 03:39:11 +00:00
|
|
|
|
|
|
|
|
|
playButton.CenterOrigin();
|
|
|
|
|
playButton.bounds.Width = (int) (0.3f * title.TrueBounds.Width);
|
|
|
|
|
playButton.CenterHorizontally(new Rectangle(0, 0, width, height));
|
|
|
|
|
playButton.bounds.Y = title.bounds.X + title.TrueBounds.Height + 30;
|
|
|
|
|
|
|
|
|
|
quitButton.CenterOrigin();
|
|
|
|
|
quitButton.bounds.Width = (int) (0.3f * title.bounds.Width);
|
|
|
|
|
quitButton.bounds.Height = (int) (0.15f * playButton.bounds.Width);
|
|
|
|
|
playButton.CenterHorizontally(new Rectangle(0, 0, width, height));
|
|
|
|
|
quitButton.bounds.Y = playButton.bounds.X + playButton.bounds.Height + 15;
|
|
|
|
|
|
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
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|