From 6b66ecc131b71be9bcae81aac644a4a30224eeda Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Tue, 31 Jan 2017 18:53:52 +0900 Subject: [PATCH] Global shadows and more sane font size setting. --- osu.Game/Beatmaps/Drawables/BeatmapPanel.cs | 7 ++++--- .../Beatmaps/Drawables/BeatmapSetHeader.cs | 5 +++-- osu.Game/Graphics/Sprites/OsuSpriteText.cs | 18 ++++++++++++++++++ osu.Game/Graphics/UserInterface/BackButton.cs | 3 ++- osu.Game/Graphics/UserInterface/KeyCounter.cs | 5 +++-- osu.Game/Graphics/UserInterface/OsuButton.cs | 12 ++++++++++-- osu.Game/Graphics/UserInterface/OsuCheckbox.cs | 6 ++---- osu.Game/Graphics/UserInterface/OsuTextBox.cs | 3 ++- .../Graphics/UserInterface/RollingCounter.cs | 3 ++- .../UserInterface/Volume/VolumeMeter.cs | 3 ++- osu.Game/Modes/UI/ComboCounter.cs | 5 +++-- .../Online/Chat/Drawables/ChannelDisplay.cs | 3 ++- osu.Game/Online/Chat/Drawables/ChatLine.cs | 7 ++++--- osu.Game/Overlays/ChatOverlay.cs | 3 ++- osu.Game/Overlays/MusicController.cs | 5 +++-- osu.Game/Overlays/Options/OptionDropdown.cs | 10 ++++------ osu.Game/Overlays/Options/OptionLabel.cs | 8 ++------ osu.Game/Overlays/Options/OptionSlider.cs | 4 ++-- osu.Game/Overlays/Options/OptionsSection.cs | 3 ++- osu.Game/Overlays/Options/OptionsSubsection.cs | 13 +++++++------ .../Options/Sections/General/LoginOptions.cs | 7 ++++--- osu.Game/Overlays/Options/SidebarButton.cs | 4 ++-- osu.Game/Overlays/OptionsOverlay.cs | 7 +++---- osu.Game/Overlays/Toolbar/ToolbarButton.cs | 7 ++++--- osu.Game/Screens/GameModeWhiteBox.cs | 5 +++-- osu.Game/Screens/Menu/Button.cs | 3 ++- osu.Game/Screens/Play/FailDialog.cs | 3 ++- osu.Game/Screens/Ranking/Results.cs | 7 ++++--- osu.Game/Screens/Select/BeatmapInfoWedge.cs | 13 +++++++------ osu.Game/Screens/Select/FooterButton.cs | 3 ++- osu.Game/osu.Game.csproj | 1 + 31 files changed, 113 insertions(+), 73 deletions(-) create mode 100644 osu.Game/Graphics/Sprites/OsuSpriteText.cs diff --git a/osu.Game/Beatmaps/Drawables/BeatmapPanel.cs b/osu.Game/Beatmaps/Drawables/BeatmapPanel.cs index fdbf7430fb..a8e2dc87d0 100644 --- a/osu.Game/Beatmaps/Drawables/BeatmapPanel.cs +++ b/osu.Game/Beatmaps/Drawables/BeatmapPanel.cs @@ -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}", diff --git a/osu.Game/Beatmaps/Drawables/BeatmapSetHeader.cs b/osu.Game/Beatmaps/Drawables/BeatmapSetHeader.cs index b15942c5bb..e3aef76b75 100644 --- a/osu.Game/Beatmaps/Drawables/BeatmapSetHeader.cs +++ b/osu.Game/Beatmaps/Drawables/BeatmapSetHeader.cs @@ -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", diff --git a/osu.Game/Graphics/Sprites/OsuSpriteText.cs b/osu.Game/Graphics/Sprites/OsuSpriteText.cs new file mode 100644 index 0000000000..7e91ae8966 --- /dev/null +++ b/osu.Game/Graphics/Sprites/OsuSpriteText.cs @@ -0,0 +1,18 @@ +//Copyright (c) 2007-2016 ppy Pty Ltd . +//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; + } + } +} diff --git a/osu.Game/Graphics/UserInterface/BackButton.cs b/osu.Game/Graphics/UserInterface/BackButton.cs index 7663c74f95..d82e6e0852 100644 --- a/osu.Game/Graphics/UserInterface/BackButton.cs +++ b/osu.Game/Graphics/UserInterface/BackButton.cs @@ -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, diff --git a/osu.Game/Graphics/UserInterface/KeyCounter.cs b/osu.Game/Graphics/UserInterface/KeyCounter.cs index 5a7fe65925..1df1f11a0f 100644 --- a/osu.Game/Graphics/UserInterface/KeyCounter.cs +++ b/osu.Game/Graphics/UserInterface/KeyCounter.cs @@ -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, diff --git a/osu.Game/Graphics/UserInterface/OsuButton.cs b/osu.Game/Graphics/UserInterface/OsuButton.cs index a199153e37..a36f43c1c8 100644 --- a/osu.Game/Graphics/UserInterface/OsuButton.cs +++ b/osu.Game/Graphics/UserInterface/OsuButton.cs @@ -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) { diff --git a/osu.Game/Graphics/UserInterface/OsuCheckbox.cs b/osu.Game/Graphics/UserInterface/OsuCheckbox.cs index c6e8559f7f..0c3869e848 100644 --- a/osu.Game/Graphics/UserInterface/OsuCheckbox.cs +++ b/osu.Game/Graphics/UserInterface/OsuCheckbox.cs @@ -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, diff --git a/osu.Game/Graphics/UserInterface/OsuTextBox.cs b/osu.Game/Graphics/UserInterface/OsuTextBox.cs index 52b5d88e26..814cf3dbdb 100644 --- a/osu.Game/Graphics/UserInterface/OsuTextBox.cs +++ b/osu.Game/Graphics/UserInterface/OsuTextBox.cs @@ -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; } diff --git a/osu.Game/Graphics/UserInterface/RollingCounter.cs b/osu.Game/Graphics/UserInterface/RollingCounter.cs index e55001fd99..98c9941665 100644 --- a/osu.Game/Graphics/UserInterface/RollingCounter.cs +++ b/osu.Game/Graphics/UserInterface/RollingCounter.cs @@ -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; diff --git a/osu.Game/Graphics/UserInterface/Volume/VolumeMeter.cs b/osu.Game/Graphics/UserInterface/Volume/VolumeMeter.cs index 37259289ce..66d946c967 100644 --- a/osu.Game/Graphics/UserInterface/Volume/VolumeMeter.cs +++ b/osu.Game/Graphics/UserInterface/Volume/VolumeMeter.cs @@ -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, diff --git a/osu.Game/Modes/UI/ComboCounter.cs b/osu.Game/Modes/UI/ComboCounter.cs index b150111387..5fbc98d8f8 100644 --- a/osu.Game/Modes/UI/ComboCounter.cs +++ b/osu.Game/Modes/UI/ComboCounter.cs @@ -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), diff --git a/osu.Game/Online/Chat/Drawables/ChannelDisplay.cs b/osu.Game/Online/Chat/Drawables/ChannelDisplay.cs index 041163b19a..b9437ae811 100644 --- a/osu.Game/Online/Chat/Drawables/ChannelDisplay.cs +++ b/osu.Game/Online/Chat/Drawables/ChannelDisplay.cs @@ -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, diff --git a/osu.Game/Online/Chat/Drawables/ChatLine.cs b/osu.Game/Online/Chat/Drawables/ChatLine.cs index 2dd3425bda..64fc031669 100644 --- a/osu.Game/Online/Chat/Drawables/ChatLine.cs +++ b/osu.Game/Online/Chat/Drawables/ChatLine.cs @@ -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, diff --git a/osu.Game/Overlays/ChatOverlay.cs b/osu.Game/Overlays/ChatOverlay.cs index 17a1a2604a..804cd9f0ab 100644 --- a/osu.Game/Overlays/ChatOverlay.cs +++ b/osu.Game/Overlays/ChatOverlay.cs @@ -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, diff --git a/osu.Game/Overlays/MusicController.cs b/osu.Game/Overlays/MusicController.cs index fa70841e5c..36410d6a76 100644 --- a/osu.Game/Overlays/MusicController.cs +++ b/osu.Game/Overlays/MusicController.cs @@ -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, diff --git a/osu.Game/Overlays/Options/OptionDropdown.cs b/osu.Game/Overlays/Options/OptionDropdown.cs index f154db71ff..6c3dc35ae9 100644 --- a/osu.Game/Overlays/Options/OptionDropdown.cs +++ b/osu.Game/Overlays/Options/OptionDropdown.cs @@ -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 { @@ -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, } } } diff --git a/osu.Game/Overlays/Options/OptionLabel.cs b/osu.Game/Overlays/Options/OptionLabel.cs index e6a7f6ab90..9cc548c7ff 100644 --- a/osu.Game/Overlays/Options/OptionLabel.cs +++ b/osu.Game/Overlays/Options/OptionLabel.cs @@ -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) { diff --git a/osu.Game/Overlays/Options/OptionSlider.cs b/osu.Game/Overlays/Options/OptionSlider.cs index 6c14d3dfeb..d48dd1d234 100644 --- a/osu.Game/Overlays/Options/OptionSlider.cs +++ b/osu.Game/Overlays/Options/OptionSlider.cs @@ -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 { diff --git a/osu.Game/Overlays/Options/OptionsSection.cs b/osu.Game/Overlays/Options/OptionsSection.cs index 5a5f22275b..7c598a92f2 100644 --- a/osu.Game/Overlays/Options/OptionsSection.cs +++ b/osu.Game/Overlays/Options/OptionsSection.cs @@ -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, diff --git a/osu.Game/Overlays/Options/OptionsSubsection.cs b/osu.Game/Overlays/Options/OptionsSubsection.cs index b7b1ff4570..8199011cc2 100644 --- a/osu.Game/Overlays/Options/OptionsSubsection.cs +++ b/osu.Game/Overlays/Options/OptionsSubsection.cs @@ -1,11 +1,12 @@ //Copyright (c) 2007-2016 ppy Pty Ltd . //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(), diff --git a/osu.Game/Overlays/Options/Sections/General/LoginOptions.cs b/osu.Game/Overlays/Options/Sections/General/LoginOptions.cs index e67b63ada3..63417c1f0c 100644 --- a/osu.Game/Overlays/Options/Sections/General/LoginOptions.cs +++ b/osu.Game/Overlays/Options/Sections/General/LoginOptions.cs @@ -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}!", }, diff --git a/osu.Game/Overlays/Options/SidebarButton.cs b/osu.Game/Overlays/Options/SidebarButton.cs index 4128bdfd7d..bfe6db5252 100644 --- a/osu.Game/Overlays/Options/SidebarButton.cs +++ b/osu.Game/Overlays/Options/SidebarButton.cs @@ -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, }, diff --git a/osu.Game/Overlays/OptionsOverlay.cs b/osu.Game/Overlays/OptionsOverlay.cs index a53fd6743f..2565056c1a 100644 --- a/osu.Game/Overlays/OptionsOverlay.cs +++ b/osu.Game/Overlays/OptionsOverlay.cs @@ -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", diff --git a/osu.Game/Overlays/Toolbar/ToolbarButton.cs b/osu.Game/Overlays/Toolbar/ToolbarButton.cs index cfdb71f3ce..e817ce7526 100644 --- a/osu.Game/Overlays/Toolbar/ToolbarButton.cs +++ b/osu.Game/Overlays/Toolbar/ToolbarButton.cs @@ -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 diff --git a/osu.Game/Screens/GameModeWhiteBox.cs b/osu.Game/Screens/GameModeWhiteBox.cs index b05ac614c6..f3400ea376 100644 --- a/osu.Game/Screens/GameModeWhiteBox.cs +++ b/osu.Game/Screens/GameModeWhiteBox.cs @@ -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, diff --git a/osu.Game/Screens/Menu/Button.cs b/osu.Game/Screens/Menu/Button.cs index ebdb89b169..8a480faf18 100644 --- a/osu.Game/Screens/Menu/Button.cs +++ b/osu.Game/Screens/Menu/Button.cs @@ -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, diff --git a/osu.Game/Screens/Play/FailDialog.cs b/osu.Game/Screens/Play/FailDialog.cs index c8718c1618..fd2ec702f1 100644 --- a/osu.Game/Screens/Play/FailDialog.cs +++ b/osu.Game/Screens/Play/FailDialog.cs @@ -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, diff --git a/osu.Game/Screens/Ranking/Results.cs b/osu.Game/Screens/Ranking/Results.cs index a4219daf54..778b1c4db1 100644 --- a/osu.Game/Screens/Ranking/Results.cs +++ b/osu.Game/Screens/Ranking/Results.cs @@ -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}", diff --git a/osu.Game/Screens/Select/BeatmapInfoWedge.cs b/osu.Game/Screens/Select/BeatmapInfoWedge.cs index 964f4552ba..9be84003fe 100644 --- a/osu.Game/Screens/Select/BeatmapInfoWedge.cs +++ b/osu.Game/Screens/Select/BeatmapInfoWedge.cs @@ -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", diff --git a/osu.Game/Screens/Select/FooterButton.cs b/osu.Game/Screens/Select/FooterButton.cs index 9d49e88716..bf592396bb 100644 --- a/osu.Game/Screens/Select/FooterButton.cs +++ b/osu.Game/Screens/Select/FooterButton.cs @@ -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, diff --git a/osu.Game/osu.Game.csproj b/osu.Game/osu.Game.csproj index 34ad6706f5..382d0203ac 100644 --- a/osu.Game/osu.Game.csproj +++ b/osu.Game/osu.Game.csproj @@ -66,6 +66,7 @@ +