1
0
mirror of https://github.com/ppy/osu.git synced 2025-01-26 12:35:34 +08:00

Move spm counter to a seperated control.

This commit is contained in:
Huo Yaoyuan 2017-10-07 15:31:42 +08:00
parent 3b6596b609
commit a876ab9b90
3 changed files with 48 additions and 19 deletions

View File

@ -24,6 +24,7 @@ namespace osu.Game.Rulesets.Osu.Objects.Drawables
private readonly SpinnerDisc disc;
private readonly SpinnerTicks ticks;
private readonly SpinnerSpmCounter spmCounter;
private readonly Container mainContainer;
@ -31,7 +32,6 @@ namespace osu.Game.Rulesets.Osu.Objects.Drawables
private readonly Container circleContainer;
private readonly CirclePiece circle;
private readonly GlowPiece glow;
private readonly OsuSpriteText spmText, spmLabel;
private bool spmShown;
@ -108,26 +108,13 @@ namespace osu.Game.Rulesets.Osu.Objects.Drawables
},
}
},
spmText = new OsuSpriteText
spmCounter = new SpinnerSpmCounter
{
Anchor = Anchor.Centre,
Origin = Anchor.BottomCentre,
Text = @"0",
Font = @"Venera",
TextSize = 24,
Origin = Anchor.Centre,
Y = 120,
Alpha = 0
},
spmLabel = new OsuSpriteText
{
Anchor = Anchor.Centre,
Origin = Anchor.TopCentre,
Text = @"SPINS PER MINUTE",
Font = @"Venera",
TextSize = 12,
Y = 125,
Alpha = 0
},
}
};
}
@ -185,8 +172,7 @@ namespace osu.Game.Rulesets.Osu.Objects.Drawables
if (!spmShown && disc.Tracking)
{
spmShown = true;
spmText.FadeIn(TIME_FADEIN);
spmLabel.FadeIn(TIME_FADEIN);
spmCounter.FadeIn(TIME_FADEIN);
}
base.Update();

View File

@ -0,0 +1,42 @@
// Copyright (c) 2007-2017 ppy Pty Ltd <contact@ppy.sh>.
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using osu.Framework.Graphics;
using osu.Framework.Graphics.Containers;
using osu.Game.Graphics.Sprites;
namespace osu.Game.Rulesets.Osu.Objects.Drawables.Pieces
{
public class SpinnerSpmCounter : Container
{
private readonly OsuSpriteText spmText;
public SpinnerSpmCounter()
{
Children = new Drawable[]
{
spmText = new OsuSpriteText
{
Anchor = Anchor.TopCentre,
Origin = Anchor.TopCentre,
Text = @"0",
Font = @"Venera",
TextSize = 24
},
new OsuSpriteText
{
Anchor = Anchor.TopCentre,
Origin = Anchor.TopCentre,
Text = @"SPINS PER MINUTE",
Font = @"Venera",
TextSize = 12,
Y = 30
}
};
}
}
}

View File

@ -68,6 +68,7 @@
<Compile Include="Objects\Drawables\Pieces\RingPiece.cs" />
<Compile Include="Objects\Drawables\Pieces\SliderBouncer.cs" />
<Compile Include="Objects\Drawables\Pieces\SpinnerDisc.cs" />
<Compile Include="Objects\Drawables\Pieces\SpinnerSpmCounter.cs" />
<Compile Include="Objects\Drawables\Pieces\SpinnerTicks.cs" />
<Compile Include="Objects\Drawables\Pieces\TrianglesPiece.cs" />
<Compile Include="Objects\Drawables\Pieces\SliderBall.cs" />