Update ScreenTitle with the new design

This commit is contained in:
Andrei Zavatski
2019-12-25 21:56:43 +03:00
parent 19ce3eba28
commit 3e34155114
4 changed files with 41 additions and 54 deletions

View File

@ -4,6 +4,7 @@
using System;
using osu.Framework.Graphics;
using osu.Framework.Graphics.Containers;
using osu.Framework.Graphics.Shapes;
using osu.Framework.Graphics.Sprites;
using osu.Game.Graphics.Sprites;
using osuTK;
@ -13,15 +14,12 @@ namespace osu.Game.Graphics.UserInterface
{
public abstract class ScreenTitle : CompositeDrawable, IHasAccentColour
{
public const float ICON_WIDTH = ICON_SIZE + icon_spacing;
public const float ICON_SIZE = 25;
public const float ICON_SIZE = 30;
private const int text_offset = 2;
private SpriteIcon iconSprite;
private readonly OsuSpriteText titleText, pageText;
private const float icon_spacing = 10;
protected IconUsage Icon
{
set
@ -63,26 +61,40 @@ namespace osu.Game.Graphics.UserInterface
new FillFlowContainer
{
AutoSizeAxes = Axes.Both,
Spacing = new Vector2(icon_spacing, 0),
Spacing = new Vector2(6, 0),
Direction = FillDirection.Horizontal,
Children = new[]
{
CreateIcon(),
new FillFlowContainer
CreateIcon().With(t =>
{
AutoSizeAxes = Axes.Both,
Direction = FillDirection.Horizontal,
Spacing = new Vector2(6, 0),
Children = new[]
t.Anchor = Anchor.Centre;
t.Origin = Anchor.Centre;
}),
titleText = new OsuSpriteText
{
Anchor = Anchor.Centre,
Origin = Anchor.Centre,
Font = OsuFont.GetFont(size: 20, weight: FontWeight.Bold),
Margin = new MarginPadding { Bottom = text_offset }
},
new CircularContainer
{
Anchor = Anchor.Centre,
Origin = Anchor.Centre,
Masking = true,
Size = new Vector2(4),
Child = new Box
{
titleText = new OsuSpriteText
{
Font = OsuFont.GetFont(size: 30, weight: FontWeight.Light),
},
pageText = new OsuSpriteText
{
Font = OsuFont.GetFont(size: 30, weight: FontWeight.Light),
}
RelativeSizeAxes = Axes.Both,
Colour = Color4.Gray,
}
},
pageText = new OsuSpriteText
{
Anchor = Anchor.Centre,
Origin = Anchor.Centre,
Font = OsuFont.GetFont(size: 20),
Margin = new MarginPadding { Bottom = text_offset }
}
}
},