main page button layout working.
This commit is contained in:
@@ -45,8 +45,8 @@ namespace RhythmBullet.Audio.Visualizer
|
||||
rectangleRenderer.Begin(true);
|
||||
for (int i = 0; i < BAR_COUNT; i++)
|
||||
{
|
||||
bar.X = (i * (bar.Width + spaceBetweenBars)) + bounds.X;
|
||||
bar.Y = bounds.Y;
|
||||
bar.X = (i * (bar.Width + spaceBetweenBars)) + Boundaries.X;
|
||||
bar.Y = Boundaries.Y;
|
||||
|
||||
bar.Height = barValue[i];
|
||||
rectangleRenderer.Draw(bar.X, bar.Y, bar.Width, bar.Height, color);
|
||||
|
@@ -37,24 +37,25 @@ namespace RhythmBullet.Screens.MainMenu
|
||||
|
||||
public override void ApplySize(int width, int height)
|
||||
{
|
||||
base.ApplySize(width, height);
|
||||
title.Scale = (width - 40) / title.texture.Width;
|
||||
title.CenterOrigin();
|
||||
title.bounds.X = width / 2;
|
||||
title.bounds.Y = height / 2;
|
||||
title.CenterHorizontally(Boundaries);
|
||||
title.CenterVertically(Boundaries);
|
||||
|
||||
|
||||
playButton.situation.Width = (int)(0.3f * title.Boundaries.Width);
|
||||
playButton.situation.Height = (int)(0.05f * title.Boundaries.Width);
|
||||
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;
|
||||
playButton.CenterHorizontally(Boundaries);
|
||||
playButton.situation.Y = (int)playButton.origin.Y + title.Boundaries.Y + title.Boundaries.Height + 30;
|
||||
|
||||
quitButton.situation.Width = (int)(0.3f * title.Boundaries.Width);
|
||||
quitButton.situation.Height = (int)(0.05f * title.Boundaries.Width);
|
||||
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;
|
||||
quitButton.CenterHorizontally(Boundaries);
|
||||
quitButton.situation.Y = (int)quitButton.origin.Y + playButton.Boundaries.Y + playButton.Boundaries.Height + 15;
|
||||
|
||||
base.ApplySize(width, height);
|
||||
}
|
||||
|
||||
public override void Draw(SpriteBatch batch)
|
||||
|
Reference in New Issue
Block a user