mirror of
https://github.com/ppy/osu.git
synced 2025-01-27 11:12:59 +08:00
Move spm counter to a seperated control.
This commit is contained in:
parent
3b6596b609
commit
a876ab9b90
@ -24,6 +24,7 @@ namespace osu.Game.Rulesets.Osu.Objects.Drawables
|
|||||||
|
|
||||||
private readonly SpinnerDisc disc;
|
private readonly SpinnerDisc disc;
|
||||||
private readonly SpinnerTicks ticks;
|
private readonly SpinnerTicks ticks;
|
||||||
|
private readonly SpinnerSpmCounter spmCounter;
|
||||||
|
|
||||||
private readonly Container mainContainer;
|
private readonly Container mainContainer;
|
||||||
|
|
||||||
@ -31,7 +32,6 @@ namespace osu.Game.Rulesets.Osu.Objects.Drawables
|
|||||||
private readonly Container circleContainer;
|
private readonly Container circleContainer;
|
||||||
private readonly CirclePiece circle;
|
private readonly CirclePiece circle;
|
||||||
private readonly GlowPiece glow;
|
private readonly GlowPiece glow;
|
||||||
private readonly OsuSpriteText spmText, spmLabel;
|
|
||||||
|
|
||||||
private bool spmShown;
|
private bool spmShown;
|
||||||
|
|
||||||
@ -108,26 +108,13 @@ namespace osu.Game.Rulesets.Osu.Objects.Drawables
|
|||||||
},
|
},
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
spmText = new OsuSpriteText
|
spmCounter = new SpinnerSpmCounter
|
||||||
{
|
{
|
||||||
Anchor = Anchor.Centre,
|
Anchor = Anchor.Centre,
|
||||||
Origin = Anchor.BottomCentre,
|
Origin = Anchor.Centre,
|
||||||
Text = @"0",
|
|
||||||
Font = @"Venera",
|
|
||||||
TextSize = 24,
|
|
||||||
Y = 120,
|
Y = 120,
|
||||||
Alpha = 0
|
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)
|
if (!spmShown && disc.Tracking)
|
||||||
{
|
{
|
||||||
spmShown = true;
|
spmShown = true;
|
||||||
spmText.FadeIn(TIME_FADEIN);
|
spmCounter.FadeIn(TIME_FADEIN);
|
||||||
spmLabel.FadeIn(TIME_FADEIN);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
base.Update();
|
base.Update();
|
||||||
|
@ -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
|
||||||
|
}
|
||||||
|
};
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
@ -68,6 +68,7 @@
|
|||||||
<Compile Include="Objects\Drawables\Pieces\RingPiece.cs" />
|
<Compile Include="Objects\Drawables\Pieces\RingPiece.cs" />
|
||||||
<Compile Include="Objects\Drawables\Pieces\SliderBouncer.cs" />
|
<Compile Include="Objects\Drawables\Pieces\SliderBouncer.cs" />
|
||||||
<Compile Include="Objects\Drawables\Pieces\SpinnerDisc.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\SpinnerTicks.cs" />
|
||||||
<Compile Include="Objects\Drawables\Pieces\TrianglesPiece.cs" />
|
<Compile Include="Objects\Drawables\Pieces\TrianglesPiece.cs" />
|
||||||
<Compile Include="Objects\Drawables\Pieces\SliderBall.cs" />
|
<Compile Include="Objects\Drawables\Pieces\SliderBall.cs" />
|
||||||
|
Loading…
Reference in New Issue
Block a user