mirror of
https://github.com/ppy/osu.git
synced 2025-01-26 16:12:54 +08:00
Add background and improve layout
This commit is contained in:
parent
a1867afbb4
commit
222459d921
@ -165,7 +165,7 @@ namespace osu.Game.Screens.Menu
|
||||
Direction = FillDirection.Vertical,
|
||||
Anchor = Anchor.BottomCentre,
|
||||
Origin = Anchor.BottomCentre,
|
||||
Spacing = new Vector2(15),
|
||||
Spacing = new Vector2(5),
|
||||
Children = new Drawable[]
|
||||
{
|
||||
menuTip = new MenuTip
|
||||
|
@ -4,12 +4,14 @@
|
||||
using osu.Framework.Allocation;
|
||||
using osu.Framework.Graphics;
|
||||
using osu.Framework.Graphics.Containers;
|
||||
using osu.Framework.Graphics.Shapes;
|
||||
using osu.Framework.Graphics.Sprites;
|
||||
using osu.Framework.Utils;
|
||||
using osu.Game.Configuration;
|
||||
using osu.Game.Graphics;
|
||||
using osu.Game.Graphics.Containers;
|
||||
using osuTK;
|
||||
using osuTK.Graphics;
|
||||
|
||||
namespace osu.Game.Screens.Menu
|
||||
{
|
||||
@ -27,14 +29,29 @@ namespace osu.Game.Screens.Menu
|
||||
|
||||
InternalChildren = new Drawable[]
|
||||
{
|
||||
new Container
|
||||
{
|
||||
RelativeSizeAxes = Axes.Both,
|
||||
Masking = true,
|
||||
CornerExponent = 2.5f,
|
||||
CornerRadius = 15,
|
||||
Children = new Drawable[]
|
||||
{
|
||||
new Box
|
||||
{
|
||||
Colour = Color4.Black,
|
||||
RelativeSizeAxes = Axes.Both,
|
||||
Alpha = 0.4f,
|
||||
},
|
||||
}
|
||||
},
|
||||
textFlow = new LinkFlowContainer
|
||||
{
|
||||
Width = 700,
|
||||
Width = 600,
|
||||
AutoSizeAxes = Axes.Y,
|
||||
TextAnchor = Anchor.TopCentre,
|
||||
Anchor = Anchor.TopCentre,
|
||||
Origin = Anchor.TopCentre,
|
||||
Spacing = new Vector2(0, 2),
|
||||
Margin = new MarginPadding(10)
|
||||
},
|
||||
};
|
||||
}
|
||||
@ -43,13 +60,11 @@ namespace osu.Game.Screens.Menu
|
||||
{
|
||||
if (!config.Get<bool>(OsuSetting.MenuTips)) return;
|
||||
|
||||
static void formatRegular(SpriteText t) => t.Font = OsuFont.GetFont(size: 20, weight: FontWeight.Regular);
|
||||
static void formatSemiBold(SpriteText t) => t.Font = OsuFont.GetFont(size: 20, weight: FontWeight.SemiBold);
|
||||
static void formatRegular(SpriteText t) => t.Font = OsuFont.GetFont(size: 16, weight: FontWeight.Regular);
|
||||
static void formatSemiBold(SpriteText t) => t.Font = OsuFont.GetFont(size: 16, weight: FontWeight.SemiBold);
|
||||
|
||||
string tip = getRandomTip();
|
||||
|
||||
AutoSizeAxes = Axes.Both;
|
||||
|
||||
textFlow.Clear();
|
||||
textFlow.AddParagraph("a tip for you:", formatSemiBold);
|
||||
textFlow.AddParagraph(tip, formatRegular);
|
||||
@ -57,8 +72,7 @@ namespace osu.Game.Screens.Menu
|
||||
this.FadeInFromZero(200, Easing.OutQuint)
|
||||
.Delay(1000 + 80 * tip.Length)
|
||||
.Then()
|
||||
.FadeOutFromOne(2000, Easing.OutQuint)
|
||||
.Finally(_ => AutoSizeAxes = Axes.X);
|
||||
.FadeOutFromOne(2000, Easing.OutQuint);
|
||||
}
|
||||
|
||||
private string getRandomTip()
|
||||
|
Loading…
Reference in New Issue
Block a user