private void load() { InternalChild = rankContainer = new Container { Origin = Anchor.Centre, Size = new Vector2(28, 14), Children = new[] { new DrawableRank(rank), overlay = new CircularContainer { RelativeSizeAxes = Axes.Both, Blending = BlendingParameters.Additive, Masking = true, EdgeEffect = new EdgeEffectParameters { Type = EdgeEffectType.Glow, Colour = OsuColour.ForRank(rank).Opacity(0.2f), Radius = 10, }, Child = new Box { RelativeSizeAxes = Axes.Both, Alpha = 0, AlwaysPresent = true, } } } }; }
public void Appear() { this.FadeIn(); if (rank < ScoreRank.A) { this .MoveToOffset(new Vector2(0, -20)) .MoveToOffset(new Vector2(0, 20), 200, Easing.OutBounce); if (rank <= ScoreRank.D) { this.Delay(700) .RotateTo(5, 150, Easing.In) .MoveToOffset(new Vector2(0, 3), 150, Easing.In); } this.FadeInFromZero(200, Easing.OutQuint); return; } flash.Colour = OsuColour.ForRank(rank); flash.FadeIn().Then().FadeOut(1200, Easing.OutQuint); if (rank >= ScoreRank.S) { rankText.ScaleTo(1.05f).ScaleTo(1, 3000, Easing.OutQuint); } if (rank >= ScoreRank.X) { flash.FadeIn().Then().FadeOut(3000); superFlash.FadeIn().Then().FadeOut(800, Easing.OutQuint); } }
private void load() { InternalChildren = new Drawable[] { rankText = new GlowingSpriteText { Anchor = Anchor.Centre, Origin = Anchor.Centre, GlowColour = OsuColour.ForRank(rank), Spacing = new Vector2(-15, 0), Text = DrawableRank.GetRankName(rank), Font = OsuFont.Numeric.With(size: 76), UseFullGlyphHeight = false }, superFlash = new BufferedContainer(cachedFrameBuffer: true) { Anchor = Anchor.Centre, Origin = Anchor.Centre, BlurSigma = new Vector2(85), Size = new Vector2(600), Blending = BlendingParameters.Additive, Alpha = 0, Children = new[] { new Box { Colour = Color4.White, Size = new Vector2(150), Anchor = Anchor.Centre, Origin = Anchor.Centre, }, }, }, flash = new BufferedContainer(cachedFrameBuffer: true) { Anchor = Anchor.Centre, Origin = Anchor.Centre, BlurSigma = new Vector2(35), BypassAutoSizeAxes = Axes.Both, Size = new Vector2(200), Blending = BlendingParameters.Additive, Alpha = 0, Scale = new Vector2(1.8f), Children = new[] { new OsuSpriteText { Anchor = Anchor.Centre, Origin = Anchor.Centre, Spacing = new Vector2(-15, 0), Text = DrawableRank.GetRankName(rank), Font = OsuFont.Numeric.With(size: 76), UseFullGlyphHeight = false, Shadow = false }, }, }, }; }
public DrawableRank(ScoreRank rank) { this.rank = rank; RelativeSizeAxes = Axes.Both; FillMode = FillMode.Fit; FillAspectRatio = 2; var rankColour = OsuColour.ForRank(rank); InternalChild = new DrawSizePreservingFillContainer { TargetDrawSize = new Vector2(64, 32), Strategy = DrawSizePreservationStrategy.Minimum, Child = new CircularContainer { Masking = true, RelativeSizeAxes = Axes.Both, Children = new Drawable[] { new Box { RelativeSizeAxes = Axes.Both, Colour = rankColour, }, new Triangles { RelativeSizeAxes = Axes.Both, ColourDark = rankColour.Darken(0.1f), ColourLight = rankColour.Lighten(0.1f), Velocity = 0.25f, }, new OsuSpriteText { Anchor = Anchor.Centre, Origin = Anchor.Centre, Spacing = new Vector2(-3, 0), Padding = new MarginPadding { Top = 5 }, Colour = getRankNameColour(), Font = OsuFont.Numeric.With(size: 25), Text = GetRankName(rank), ShadowColour = Color4.Black.Opacity(0.3f), ShadowOffset = new Vector2(0, 0.08f), Shadow = true, }, } } }; }
private void load() { InternalChildren = new Drawable[] { new SmoothCircularProgress { Name = "Background circle", Anchor = Anchor.Centre, Origin = Anchor.Centre, RelativeSizeAxes = Axes.Both, Colour = OsuColour.Gray(47), Alpha = 0.5f, InnerRadius = accuracy_circle_radius + 0.01f, // Extends a little bit into the circle Current = { Value = 1 }, }, accuracyCircle = new SmoothCircularProgress { Name = "Accuracy circle", Anchor = Anchor.Centre, Origin = Anchor.Centre, RelativeSizeAxes = Axes.Both, Colour = ColourInfo.GradientVertical(Color4Extensions.FromHex("#7CF6FF"), Color4Extensions.FromHex("#BAFFA9")), InnerRadius = accuracy_circle_radius, }, new BufferedContainer { Name = "Graded circles", Anchor = Anchor.Centre, Origin = Anchor.Centre, RelativeSizeAxes = Axes.Both, Size = new Vector2(0.8f), Padding = new MarginPadding(2), Children = new Drawable[] { new SmoothCircularProgress { RelativeSizeAxes = Axes.Both, Colour = OsuColour.ForRank(ScoreRank.X), InnerRadius = RANK_CIRCLE_RADIUS, Current = { Value = 1 } }, new SmoothCircularProgress { RelativeSizeAxes = Axes.Both, Colour = OsuColour.ForRank(ScoreRank.S), InnerRadius = RANK_CIRCLE_RADIUS, Current = { Value = 1 - virtual_ss_percentage } }, new SmoothCircularProgress { RelativeSizeAxes = Axes.Both, Colour = OsuColour.ForRank(ScoreRank.A), InnerRadius = RANK_CIRCLE_RADIUS, Current = { Value = 0.95f } }, new SmoothCircularProgress { RelativeSizeAxes = Axes.Both, Colour = OsuColour.ForRank(ScoreRank.B), InnerRadius = RANK_CIRCLE_RADIUS, Current = { Value = 0.9f } }, new SmoothCircularProgress { RelativeSizeAxes = Axes.Both, Colour = OsuColour.ForRank(ScoreRank.C), InnerRadius = RANK_CIRCLE_RADIUS, Current = { Value = 0.8f } }, new SmoothCircularProgress { RelativeSizeAxes = Axes.Both, Colour = OsuColour.ForRank(ScoreRank.D), InnerRadius = RANK_CIRCLE_RADIUS, Current = { Value = 0.7f } }, new RankNotch(0), new RankNotch((float)(1 - virtual_ss_percentage)), new RankNotch(0.95f), new RankNotch(0.9f), new RankNotch(0.8f), new RankNotch(0.7f), new BufferedContainer { Name = "Graded circle mask", RelativeSizeAxes = Axes.Both, Padding = new MarginPadding(1), Blending = new BlendingParameters { Source = BlendingType.DstColor, Destination = BlendingType.OneMinusSrcAlpha, SourceAlpha = BlendingType.One, DestinationAlpha = BlendingType.SrcAlpha }, Child = innerMask = new SmoothCircularProgress { RelativeSizeAxes = Axes.Both, InnerRadius = RANK_CIRCLE_RADIUS - 0.01f, } } } }, badges = new Container <RankBadge> { Name = "Rank badges", RelativeSizeAxes = Axes.Both, Padding = new MarginPadding { Vertical = -15, Horizontal = -20 }, Children = new[] { new RankBadge(1, getRank(ScoreRank.X)), new RankBadge(0.95, getRank(ScoreRank.S)), new RankBadge(0.9, getRank(ScoreRank.A)), new RankBadge(0.8, getRank(ScoreRank.B)), new RankBadge(0.7, getRank(ScoreRank.C)), new RankBadge(0.35, getRank(ScoreRank.D)), } }, rankText = new RankText(score.Rank) }; if (withFlair) { AddRangeInternal(new Drawable[] { rankImpactSound = new PoolableSkinnableSample(new SampleInfo(impactSampleName)), rankApplauseSound = new PoolableSkinnableSample(new SampleInfo(@"applause", applauseSampleName)), scoreTickSound = new PoolableSkinnableSample(new SampleInfo(@"Results/score-tick")), badgeTickSound = new PoolableSkinnableSample(new SampleInfo(@"Results/badge-dink")), badgeMaxSound = new PoolableSkinnableSample(new SampleInfo(@"Results/badge-dink-max")), swooshUpSound = new PoolableSkinnableSample(new SampleInfo(@"Results/swoosh-up")), }); } }
private void load() { InternalChildren = new Drawable[] { new SmoothCircularProgress { Name = "Background circle", Anchor = Anchor.Centre, Origin = Anchor.Centre, RelativeSizeAxes = Axes.Both, Colour = OsuColour.Gray(47), Alpha = 0.5f, InnerRadius = accuracy_circle_radius + 0.01f, // Extends a little bit into the circle Current = { Value = 1 }, }, accuracyCircle = new SmoothCircularProgress { Name = "Accuracy circle", Anchor = Anchor.Centre, Origin = Anchor.Centre, RelativeSizeAxes = Axes.Both, Colour = ColourInfo.GradientVertical(Color4Extensions.FromHex("#7CF6FF"), Color4Extensions.FromHex("#BAFFA9")), InnerRadius = accuracy_circle_radius, }, new BufferedContainer { Name = "Graded circles", Anchor = Anchor.Centre, Origin = Anchor.Centre, RelativeSizeAxes = Axes.Both, Size = new Vector2(0.8f), Padding = new MarginPadding(2), Children = new Drawable[] { new SmoothCircularProgress { RelativeSizeAxes = Axes.Both, Colour = OsuColour.ForRank(ScoreRank.X), InnerRadius = RANK_CIRCLE_RADIUS, Current = { Value = 1 } }, new SmoothCircularProgress { RelativeSizeAxes = Axes.Both, Colour = OsuColour.ForRank(ScoreRank.S), InnerRadius = RANK_CIRCLE_RADIUS, Current = { Value = 1 - virtual_ss_percentage } }, new SmoothCircularProgress { RelativeSizeAxes = Axes.Both, Colour = OsuColour.ForRank(ScoreRank.A), InnerRadius = RANK_CIRCLE_RADIUS, Current = { Value = 0.95f } }, new SmoothCircularProgress { RelativeSizeAxes = Axes.Both, Colour = OsuColour.ForRank(ScoreRank.B), InnerRadius = RANK_CIRCLE_RADIUS, Current = { Value = 0.9f } }, new SmoothCircularProgress { RelativeSizeAxes = Axes.Both, Colour = OsuColour.ForRank(ScoreRank.C), InnerRadius = RANK_CIRCLE_RADIUS, Current = { Value = 0.8f } }, new SmoothCircularProgress { RelativeSizeAxes = Axes.Both, Colour = OsuColour.ForRank(ScoreRank.D), InnerRadius = RANK_CIRCLE_RADIUS, Current = { Value = 0.7f } }, new RankNotch(0), new RankNotch((float)(1 - virtual_ss_percentage)), new RankNotch(0.95f), new RankNotch(0.9f), new RankNotch(0.8f), new RankNotch(0.7f), new BufferedContainer { Name = "Graded circle mask", RelativeSizeAxes = Axes.Both, Padding = new MarginPadding(1), Blending = new BlendingParameters { Source = BlendingType.DstColor, Destination = BlendingType.OneMinusSrcAlpha, SourceAlpha = BlendingType.One, DestinationAlpha = BlendingType.SrcAlpha }, Child = innerMask = new SmoothCircularProgress { RelativeSizeAxes = Axes.Both, InnerRadius = RANK_CIRCLE_RADIUS - 0.01f, } } } }, badges = new Container <RankBadge> { Name = "Rank badges", RelativeSizeAxes = Axes.Both, Padding = new MarginPadding { Vertical = -15, Horizontal = -20 }, Children = new[] { new RankBadge(1f, ScoreRank.X), new RankBadge(0.95f, ScoreRank.S), new RankBadge(0.9f, ScoreRank.A), new RankBadge(0.8f, ScoreRank.B), new RankBadge(0.7f, ScoreRank.C), new RankBadge(0.35f, ScoreRank.D), } }, rankText = new RankText(score.Rank) }; }