Global shadows and more sane font size setting.

This commit is contained in:
Dean Herbert 2017-01-31 18:53:52 +09:00
parent 9e5000d448
commit 6b66ecc131
31 changed files with 113 additions and 73 deletions

View File

@ -17,6 +17,7 @@
using OpenTK;
using OpenTK.Graphics;
using osu.Framework.Input;
using osu.Game.Graphics.Sprites;
using osu.Game.Modes;
namespace osu.Game.Beatmaps.Drawables
@ -105,7 +106,7 @@ public BeatmapPanel(BeatmapInfo beatmap)
Spacing = new Vector2(4, 0),
Children = new[]
{
new SpriteText
new OsuSpriteText
{
Font = @"Exo2.0-Medium",
Text = beatmap.Version,
@ -113,7 +114,7 @@ public BeatmapPanel(BeatmapInfo beatmap)
Anchor = Anchor.BottomLeft,
Origin = Anchor.BottomLeft
},
new SpriteText
new OsuSpriteText
{
Font = @"Exo2.0-Medium",
Text = "mapped by",
@ -121,7 +122,7 @@ public BeatmapPanel(BeatmapInfo beatmap)
Anchor = Anchor.BottomLeft,
Origin = Anchor.BottomLeft
},
new SpriteText
new OsuSpriteText
{
Font = @"Exo2.0-MediumItalic",
Text = $"{(beatmap.Metadata ?? beatmap.BeatmapSet.Metadata).Author}",

View File

@ -12,6 +12,7 @@
using osu.Framework.Graphics.Sprites;
using osu.Game.Configuration;
using osu.Game.Graphics;
using osu.Game.Graphics.Sprites;
using OpenTK;
using OpenTK.Graphics;
@ -43,14 +44,14 @@ public BeatmapSetHeader(WorkingBeatmap beatmap)
AutoSizeAxes = Axes.Both,
Children = new[]
{
title = new SpriteText
title = new OsuSpriteText
{
Font = @"Exo2.0-BoldItalic",
Text = beatmap.BeatmapSetInfo.Metadata.Title,
TextSize = 22,
Shadow = true,
},
artist = new SpriteText
artist = new OsuSpriteText
{
Margin = new MarginPadding { Top = -1 },
Font = @"Exo2.0-SemiBoldItalic",

View File

@ -0,0 +1,18 @@
//Copyright (c) 2007-2016 ppy Pty Ltd <contact@ppy.sh>.
//Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
using osu.Framework.Graphics.Sprites;
namespace osu.Game.Graphics.Sprites
{
class OsuSpriteText : SpriteText
{
public const float FONT_SIZE = 16;
public OsuSpriteText()
{
Shadow = true;
TextSize = FONT_SIZE;
}
}
}

View File

@ -11,6 +11,7 @@
using osu.Framework.Graphics.Containers;
using osu.Framework.Graphics.Transformations;
using osu.Framework.Input;
using osu.Game.Graphics.Sprites;
namespace osu.Game.Graphics.UserInterface
{
@ -133,7 +134,7 @@ private void load(AudioManager audio, OsuColour colours)
Shear = new Vector2(shear, 0),
EdgeSmoothness = new Vector2(1.5f, 0),
},
new SpriteText
new OsuSpriteText
{
Origin = Anchor.Centre,
Anchor = Anchor.Centre,

View File

@ -9,6 +9,7 @@
using osu.Framework.Graphics.Containers;
using osu.Framework.Graphics.Sprites;
using osu.Framework.Graphics.Textures;
using osu.Game.Graphics.Sprites;
namespace osu.Game.Graphics.UserInterface
{
@ -86,7 +87,7 @@ private void load(TextureStore textures)
RelativeSizeAxes = Axes.Both,
Children = new Drawable[]
{
new SpriteText
new OsuSpriteText
{
Text = Name,
Anchor = Anchor.Centre,
@ -95,7 +96,7 @@ private void load(TextureStore textures)
Position = new Vector2(0, -0.25f),
Colour = KeyUpTextColor
},
countSpriteText = new SpriteText
countSpriteText = new OsuSpriteText
{
Text = Count.ToString(@"#,0"),
Anchor = Anchor.Centre,

View File

@ -5,8 +5,10 @@
using OpenTK.Graphics;
using osu.Framework.Allocation;
using osu.Framework.Graphics;
using osu.Framework.Graphics.Sprites;
using osu.Framework.Graphics.UserInterface;
using osu.Game.Graphics.Backgrounds;
using osu.Game.Graphics.Sprites;
using osu.Game.Overlays;
namespace osu.Game.Graphics.UserInterface
@ -16,9 +18,15 @@ public class OsuButton : Button
public OsuButton()
{
Height = 40;
SpriteText.TextSize = OptionsOverlay.FONT_SIZE;
}
protected override SpriteText CreateText() => new OsuSpriteText
{
Depth = -1,
Origin = Anchor.Centre,
Anchor = Anchor.Centre,
};
[BackgroundDependencyLoader]
private void load(OsuColour colours)
{

View File

@ -14,6 +14,7 @@
using osu.Framework.Graphics.Transformations;
using osu.Framework.Graphics.UserInterface;
using osu.Framework.Input;
using osu.Game.Graphics.Sprites;
using osu.Game.Overlays;
using OpenTK;
using OpenTK.Graphics;
@ -77,10 +78,7 @@ public OsuCheckbox()
Children = new Drawable[]
{
labelSpriteText = new SpriteText
{
TextSize = OptionsOverlay.FONT_SIZE,
},
labelSpriteText = new OsuSpriteText(),
light = new Light
{
Anchor = Anchor.CentreRight,

View File

@ -5,6 +5,7 @@
using osu.Framework.Graphics;
using osu.Framework.Graphics.UserInterface;
using osu.Framework.Input;
using osu.Game.Graphics.Sprites;
using osu.Game.Overlays;
using OpenTK.Graphics;
@ -15,7 +16,7 @@ public class OsuTextBox : TextBox
public OsuTextBox()
{
Height = 40;
TextContainer.Height = OptionsOverlay.FONT_SIZE / Height;
TextContainer.Height = OsuSpriteText.FONT_SIZE / Height;
CornerRadius = 5;
}

View File

@ -8,6 +8,7 @@
using System;
using System.Collections.Generic;
using System.Diagnostics;
using osu.Game.Graphics.Sprites;
namespace osu.Game.Graphics.UserInterface
{
@ -106,7 +107,7 @@ protected RollingCounter()
{
Children = new Drawable[]
{
DisplayedCountSpriteText = new SpriteText(),
DisplayedCountSpriteText = new OsuSpriteText(),
};
TextSize = 40;

View File

@ -8,6 +8,7 @@
using osu.Framework.Graphics.Sprites;
using osu.Framework.Graphics.Transformations;
using osu.Framework.Input;
using osu.Game.Graphics.Sprites;
using OpenTK;
using OpenTK.Graphics;
@ -51,7 +52,7 @@ public VolumeMeter(string meterName)
}
}
},
new SpriteText
new OsuSpriteText
{
Text = meterName,
Anchor = Anchor.BottomCentre,

View File

@ -7,6 +7,7 @@
using osu.Framework.Graphics.Sprites;
using osu.Framework.Graphics.Transformations;
using osu.Framework.MathUtils;
using osu.Game.Graphics.Sprites;
namespace osu.Game.Modes.UI
{
@ -100,11 +101,11 @@ protected ComboCounter()
Children = new Drawable[]
{
DisplayedCountSpriteText = new SpriteText
DisplayedCountSpriteText = new OsuSpriteText
{
Alpha = 0,
},
PopOutCount = new SpriteText
PopOutCount = new OsuSpriteText
{
Alpha = 0,
Margin = new MarginPadding(0.05f),

View File

@ -8,6 +8,7 @@
using osu.Framework.Graphics;
using osu.Framework.Graphics.Containers;
using osu.Framework.Graphics.Sprites;
using osu.Game.Graphics.Sprites;
using OpenTK;
namespace osu.Game.Online.Chat.Drawables
@ -27,7 +28,7 @@ public ChannelDisplay(Channel channel)
Children = new Drawable[]
{
new SpriteText
new OsuSpriteText
{
Text = channel.Name,
TextSize = 50,

View File

@ -5,6 +5,7 @@
using osu.Framework.Graphics.Containers;
using osu.Framework.Graphics.Primitives;
using osu.Framework.Graphics.Sprites;
using osu.Game.Graphics.Sprites;
using OpenTK;
using OpenTK.Graphics;
@ -31,13 +32,13 @@ public ChatLine(Message message)
Size = new Vector2(padding, text_size),
Children = new Drawable[]
{
new SpriteText
new OsuSpriteText
{
Text = Message.Timestamp.LocalDateTime.ToLongTimeString(),
TextSize = text_size,
Colour = Color4.Gray
},
new SpriteText
new OsuSpriteText
{
Text = Message.User.Name,
TextSize = text_size,
@ -53,7 +54,7 @@ public ChatLine(Message message)
Padding = new MarginPadding { Left = padding + 10 },
Children = new Drawable[]
{
new SpriteText
new OsuSpriteText
{
Text = Message.Content,
TextSize = text_size,

View File

@ -14,6 +14,7 @@
using osu.Framework.Graphics.Transformations;
using osu.Framework.Threading;
using osu.Game.Graphics;
using osu.Game.Graphics.Sprites;
using osu.Game.Online.API;
using osu.Game.Online.API.Requests;
using osu.Game.Online.Chat;
@ -137,7 +138,7 @@ private void initializeChannels()
// return;
SpriteText loading;
Add(loading = new SpriteText
Add(loading = new OsuSpriteText
{
Text = @"Loading available channels...",
Anchor = Anchor.Centre,

View File

@ -23,6 +23,7 @@
using osu.Game.Database;
using osu.Game.Graphics;
using osu.Framework.Graphics.Primitives;
using osu.Game.Graphics.Sprites;
namespace osu.Game.Overlays
{
@ -95,7 +96,7 @@ private void load(OsuGameBase osuGame, OsuConfigManager config, BeatmapDatabase
RelativeSizeAxes = Axes.Both,
Children = new Drawable[]
{
title = new SpriteText
title = new OsuSpriteText
{
Origin = Anchor.BottomCentre,
Anchor = Anchor.TopCentre,
@ -105,7 +106,7 @@ private void load(OsuGameBase osuGame, OsuConfigManager config, BeatmapDatabase
Text = @"Nothing to play",
Font = @"Exo2.0-MediumItalic"
},
artist = new SpriteText
artist = new OsuSpriteText
{
Origin = Anchor.TopCentre,
Anchor = Anchor.TopCentre,

View File

@ -13,6 +13,7 @@
using osu.Framework.Graphics.Sprites;
using osu.Framework.Graphics.UserInterface;
using osu.Game.Graphics;
using osu.Game.Graphics.Sprites;
namespace osu.Game.Overlays.Options
{
@ -72,9 +73,8 @@ public OptionDropdown()
AutoSizeAxes = Axes.Y;
Children = new Drawable[]
{
text = new SpriteText {
text = new OsuSpriteText {
Alpha = 0,
TextSize = OptionsOverlay.FONT_SIZE
},
dropdown = new StyledDropDownMenu<T>
{
@ -150,11 +150,10 @@ public StyledDropDownComboBox()
Children = new[]
{
label = new SpriteText()
label = new OsuSpriteText
{
Anchor = Anchor.CentreLeft,
Origin = Anchor.CentreLeft,
TextSize = OptionsOverlay.FONT_SIZE,
},
new TextAwesome
{
@ -199,9 +198,8 @@ public StyledDropDownMenuItem(string text, U value) : base(text, value)
Origin = Anchor.CentreLeft,
Anchor = Anchor.CentreLeft,
},
new SpriteText {
new OsuSpriteText {
Text = text,
TextSize = OptionsOverlay.FONT_SIZE,
}
}
}

View File

@ -4,16 +4,12 @@
using osu.Framework.Allocation;
using osu.Framework.Graphics.Sprites;
using osu.Game.Graphics;
using osu.Game.Graphics.Sprites;
namespace osu.Game.Overlays.Options
{
class OptionLabel : SpriteText
class OptionLabel : OsuSpriteText
{
public OptionLabel()
{
TextSize = OptionsOverlay.FONT_SIZE;
}
[BackgroundDependencyLoader]
private void load(OsuColour colour)
{

View File

@ -18,6 +18,7 @@
using osu.Framework.Input;
using osu.Game.Graphics;
using System.Linq;
using osu.Game.Graphics.Sprites;
namespace osu.Game.Overlays.Options
{
@ -49,9 +50,8 @@ public OptionSlider()
AutoSizeAxes = Axes.Y;
Children = new Drawable[]
{
text = new SpriteText {
text = new OsuSpriteText {
Alpha = 0,
TextSize = OptionsOverlay.FONT_SIZE,
},
slider = new OsuSliderBar<T>
{

View File

@ -9,6 +9,7 @@
using osu.Framework.Graphics.Primitives;
using osu.Framework.Graphics.Sprites;
using osu.Game.Graphics;
using osu.Game.Graphics.Sprites;
namespace osu.Game.Overlays.Options
{
@ -51,7 +52,7 @@ public OptionsSection()
AutoSizeAxes = Axes.Y,
Children = new[]
{
headerLabel = new SpriteText
headerLabel = new OsuSpriteText
{
TextSize = headerSize,
Text = Header,

View File

@ -1,11 +1,12 @@
//Copyright (c) 2007-2016 ppy Pty Ltd <contact@ppy.sh>.
//Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
using OpenTK;
using osu.Framework.Graphics;
using osu.Framework.Graphics.Containers;
using osu.Framework.Graphics.Sprites;
using OpenTK;
using osu.Framework.Graphics;
using osu.Framework.Graphics.Containers;
using osu.Framework.Graphics.Sprites;
using osu.Game.Graphics.Sprites;
namespace osu.Game.Overlays.Options
{
public abstract class OptionsSubsection : Container
@ -29,7 +30,7 @@ public OptionsSubsection()
Spacing = new Vector2(0, 5),
Children = new[]
{
new SpriteText
new OsuSpriteText
{
TextSize = 17,
Text = Header.ToUpper(),

View File

@ -8,6 +8,7 @@
using osu.Framework.Graphics.Sprites;
using osu.Framework.Graphics.UserInterface;
using osu.Game.Configuration;
using osu.Game.Graphics.Sprites;
using osu.Game.Graphics.UserInterface;
using osu.Game.Online.API;
using OpenTK;
@ -51,7 +52,7 @@ public void APIStateChanged(APIAccess api, APIState state)
case APIState.Failing:
Children = new Drawable[]
{
new SpriteText
new OsuSpriteText
{
Text = "Connection failing :(",
},
@ -60,7 +61,7 @@ public void APIStateChanged(APIAccess api, APIState state)
case APIState.Connecting:
Children = new Drawable[]
{
new SpriteText
new OsuSpriteText
{
Text = "Connecting...",
},
@ -69,7 +70,7 @@ public void APIStateChanged(APIAccess api, APIState state)
case APIState.Online:
Children = new Drawable[]
{
new SpriteText
new OsuSpriteText
{
Text = $"Connected as {api.Username}!",
},

View File

@ -10,6 +10,7 @@
using osu.Framework.Graphics.Sprites;
using osu.Framework.Input;
using osu.Game.Graphics;
using osu.Game.Graphics.Sprites;
namespace osu.Game.Overlays.Options
{
@ -76,10 +77,9 @@ public SidebarButton()
},
}
},
headerText = new SpriteText
headerText = new OsuSpriteText
{
Position = new Vector2(OptionsSidebar.default_width + 10, 0),
TextSize = OptionsOverlay.FONT_SIZE,
Anchor = Anchor.CentreLeft,
Origin = Anchor.CentreLeft,
},

View File

@ -18,14 +18,13 @@
using osu.Game.Overlays.Options;
using System;
using osu.Game.Graphics;
using osu.Game.Graphics.Sprites;
using osu.Game.Overlays.Options.Sections;
namespace osu.Game.Overlays
{
public class OptionsOverlay : OverlayContainer
{
public const float FONT_SIZE = 16;
internal const float CONTENT_MARGINS = 10;
public const float TRANSITION_LENGTH = 600;
@ -87,13 +86,13 @@ private void load(OsuGame game, OsuColour colours)
Children = new Drawable[]
{
new SpriteText
new OsuSpriteText
{
Text = "settings",
TextSize = 40,
Margin = new MarginPadding { Left = CONTENT_MARGINS, Top = 30 },
},
new SpriteText
new OsuSpriteText
{
Colour = colours.Pink,
Text = "Change the way osu! behaves",

View File

@ -13,6 +13,7 @@
using osu.Framework.Input;
using osu.Game.Graphics;
using osu.Game.Graphics.Backgrounds;
using osu.Game.Graphics.Sprites;
using OpenTK;
using OpenTK.Graphics;
@ -90,7 +91,7 @@ public ToolbarButton()
Anchor = Anchor.CentreLeft,
Origin = Anchor.CentreLeft,
},
DrawableText = new SpriteText
DrawableText = new OsuSpriteText
{
Anchor = Anchor.CentreLeft,
Origin = Anchor.CentreLeft,
@ -106,13 +107,13 @@ public ToolbarButton()
Alpha = 0,
Children = new[]
{
tooltip1 = new SpriteText
tooltip1 = new OsuSpriteText
{
Shadow = true,
TextSize = 22,
Font = @"Exo2.0-Bold",
},
tooltip2 = new SpriteText
tooltip2 = new OsuSpriteText
{
Shadow = true,
TextSize = 16

View File

@ -9,6 +9,7 @@
using osu.Framework.Graphics.Sprites;
using osu.Framework.Graphics.Transformations;
using osu.Framework.Graphics.UserInterface;
using osu.Game.Graphics.Sprites;
using osu.Game.Screens.Backgrounds;
using osu.Game.Graphics.UserInterface;
using OpenTK;
@ -98,14 +99,14 @@ public GameModeWhiteBox()
Origin = Anchor.Centre,
Children = new[]
{
new SpriteText
new OsuSpriteText
{
Text = GetType().Name,
Anchor = Anchor.Centre,
Origin = Anchor.Centre,
TextSize = 50,
},
new SpriteText
new OsuSpriteText
{
Text = GetType().Namespace,
Anchor = Anchor.Centre,

View File

@ -12,6 +12,7 @@
using osu.Framework.Graphics.Transformations;
using osu.Framework.Input;
using osu.Game.Graphics;
using osu.Game.Graphics.Sprites;
using OpenTK;
using OpenTK.Graphics;
using OpenTK.Input;
@ -100,7 +101,7 @@ public Button(string text, string internalName, FontAwesome symbol, Color4 colou
Position = new Vector2(0, 0),
Icon = symbol
},
new SpriteText
new OsuSpriteText
{
Shadow = true,
Direction = FlowDirection.HorizontalOnly,

View File

@ -6,6 +6,7 @@
using osu.Framework.Graphics.Containers;
using osu.Framework.Graphics.Sprites;
using osu.Framework.Graphics.Transformations;
using osu.Game.Graphics.Sprites;
using osu.Game.Modes;
using osu.Game.Screens.Backgrounds;
using OpenTK;
@ -21,7 +22,7 @@ class FailDialog : OsuGameMode
public FailDialog()
{
Add(new SpriteText
Add(new OsuSpriteText
{
Text = "You failed!",
Anchor = Anchor.Centre,

View File

@ -6,6 +6,7 @@
using osu.Framework.Graphics.Containers;
using osu.Framework.Graphics.Sprites;
using osu.Framework.Graphics.Transformations;
using osu.Game.Graphics.Sprites;
using osu.Game.Modes;
using osu.Game.Screens.Backgrounds;
using OpenTK;
@ -71,17 +72,17 @@ public ScoreDisplay(Score s)
Direction = FlowDirection.VerticalOnly,
Children = new Drawable[]
{
new SpriteText
new OsuSpriteText
{
TextSize = 40,
Text = $@"Accuracy: {s.Accuracy:#0.00%}",
},
new SpriteText
new OsuSpriteText
{
TextSize = 40,
Text = $@"Score: {s.TotalScore}",
},
new SpriteText
new OsuSpriteText
{
TextSize = 40,
Text = $@"MaxCombo: {s.MaxCombo}",

View File

@ -20,6 +20,7 @@
using osu.Framework.MathUtils;
using osu.Game.Graphics;
using osu.Game.Beatmaps.Timing;
using osu.Game.Graphics.Sprites;
using osu.Game.Modes;
namespace osu.Game.Screens.Select
@ -131,14 +132,14 @@ public void UpdateBeatmap(WorkingBeatmap beatmap)
AutoSizeAxes = Axes.Both,
Children = new Drawable[]
{
new SpriteText
new OsuSpriteText
{
Font = @"Exo2.0-MediumItalic",
Text = beatmapSetInfo.Metadata.Artist + " -- " + beatmapSetInfo.Metadata.Title,
TextSize = 28,
Shadow = true,
},
new SpriteText
new OsuSpriteText
{
Font = @"Exo2.0-MediumItalic",
Text = beatmapInfo.Version,
@ -152,14 +153,14 @@ public void UpdateBeatmap(WorkingBeatmap beatmap)
AutoSizeAxes = Axes.Both,
Children = new []
{
new SpriteText
new OsuSpriteText
{
Font = @"Exo2.0-Medium",
Text = "mapped by ",
TextSize = 15,
Shadow = true,
},
new SpriteText
new OsuSpriteText
{
Font = @"Exo2.0-Bold",
Text = beatmapSetInfo.Metadata.Author,
@ -204,7 +205,7 @@ public class InfoLabel : Container
public InfoLabel(BeatmapStatistic statistic)
{
AutoSizeAxes = Axes.Both;
Children = new[]
Children = new Drawable[]
{
new TextAwesome
{
@ -218,7 +219,7 @@ public InfoLabel(BeatmapStatistic statistic)
Colour = new Color4(255, 221, 85, 255),
Scale = new Vector2(0.8f)
},
new SpriteText
new OsuSpriteText
{
Margin = new MarginPadding { Left = 13 },
Font = @"Exo2.0-Bold",

View File

@ -9,6 +9,7 @@
using osu.Framework.Input;
using System;
using osu.Framework.Graphics.Transformations;
using osu.Game.Graphics.Sprites;
namespace osu.Game.Screens.Select
{
@ -72,7 +73,7 @@ public FooterButton()
EdgeSmoothness = new Vector2(2, 0),
RelativeSizeAxes = Axes.X,
},
spriteText = new SpriteText
spriteText = new OsuSpriteText
{
Anchor = Anchor.Centre,
Origin = Anchor.Centre,

View File

@ -66,6 +66,7 @@
<Compile Include="Beatmaps\Drawables\BeatmapBackgroundSprite.cs" />
<Compile Include="Graphics\Backgrounds\Triangles.cs" />
<Compile Include="Graphics\Cursor\CursorTrail.cs" />
<Compile Include="Graphics\Sprites\OsuSpriteText.cs" />
<Compile Include="Graphics\UserInterface\BackButton.cs" />
<Compile Include="Graphics\UserInterface\OsuTextBox.cs" />
<Compile Include="Modes\Objects\HitObjectParser.cs" />