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-09 06:26:59 +00:00
|
|
|
|
base.ApplySize(width, height);
|
2019-03-02 05:30:43 +00:00
|
|
|
|
title.Scale = (width - 40) / title.texture.Width;
|
|
|
|
|
title.CenterOrigin();
|
2019-03-09 06:26:59 +00:00
|
|
|
|
title.CenterHorizontally(Boundaries);
|
|
|
|
|
title.CenterVertically(Boundaries);
|
2019-01-28 17:41:36 +00:00
|
|
|
|
|
2019-03-09 03:39:11 +00:00
|
|
|
|
|
2019-03-09 06:26:59 +00:00
|
|
|
|
playButton.situation.Width = (int)(0.3f * title.Boundaries.Width);
|
|
|
|
|
playButton.situation.Height = (int)(0.05f * title.Boundaries.Width);
|
2019-03-09 03:39:11 +00:00
|
|
|
|
playButton.CenterOrigin();
|
2019-03-09 06:26:59 +00:00
|
|
|
|
playButton.CenterHorizontally(Boundaries);
|
2019-03-09 06:50:46 +00:00
|
|
|
|
playButton.situation.Y = (int)playButton.origin.Y + title.Boundaries.Y + title.Boundaries.Height + 60;
|
2019-03-09 03:39:11 +00:00
|
|
|
|
|
2019-03-09 06:26:59 +00:00
|
|
|
|
quitButton.situation.Width = (int)(0.3f * title.Boundaries.Width);
|
|
|
|
|
quitButton.situation.Height = (int)(0.05f * title.Boundaries.Width);
|
2019-03-09 03:39:11 +00:00
|
|
|
|
quitButton.CenterOrigin();
|
2019-03-09 06:26:59 +00:00
|
|
|
|
quitButton.CenterHorizontally(Boundaries);
|
|
|
|
|
quitButton.situation.Y = (int)quitButton.origin.Y + playButton.Boundaries.Y + playButton.Boundaries.Height + 15;
|
2019-03-09 03:39:11 +00:00
|
|
|
|
|
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
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|