From 00d8cacba8f8a7ac5c242db12a5c34ef55e17420 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Thu, 20 Apr 2017 16:05:25 +0900 Subject: [PATCH] Update visual apperance. --- osu.Game/Graphics/Cursor/TooltipContainer.cs | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) diff --git a/osu.Game/Graphics/Cursor/TooltipContainer.cs b/osu.Game/Graphics/Cursor/TooltipContainer.cs index 30acedb4e7..59cd06c7f5 100644 --- a/osu.Game/Graphics/Cursor/TooltipContainer.cs +++ b/osu.Game/Graphics/Cursor/TooltipContainer.cs @@ -68,7 +68,7 @@ namespace osu.Game.Graphics.Cursor { if (currentlyDisplayed != null && !state.Mouse.HasMainButtonPressed) { - tooltip.Delay(100); + tooltip.Delay(150); tooltip.FadeOut(500, EasingTypes.OutQuint); currentlyDisplayed = null; } @@ -92,23 +92,31 @@ namespace osu.Game.Graphics.Cursor public class Tooltip : Container { - private readonly Box tooltipBackground; + private readonly Box background; private readonly OsuSpriteText text; public string TooltipText { set { + if (value == text.Text) return; + text.Text = value; + if (Alpha > 0) + background.FlashColour(Color4.Gray, 200, EasingTypes.Out); } } public override bool HandleInput => false; + private const float text_size = 16; + public Tooltip() { - + AutoSizeDuration = 250; + AutoSizeEasing = EasingTypes.OutQuint; AutoSizeAxes = Axes.Both; + CornerRadius = 5; Masking = true; EdgeEffect = new EdgeEffect @@ -119,12 +127,13 @@ namespace osu.Game.Graphics.Cursor }; Children = new Drawable[] { - tooltipBackground = new Box + background = new Box { RelativeSizeAxes = Axes.Both }, text = new OsuSpriteText { + TextSize = text_size, Padding = new MarginPadding(5), Font = @"Exo2.0-Regular", } @@ -134,7 +143,7 @@ namespace osu.Game.Graphics.Cursor [BackgroundDependencyLoader] private void load(OsuColour colour) { - tooltipBackground.Colour = colour.Gray3; + background.Colour = colour.Gray3; } } }