示例#1
0
        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")),
                });
            }
        }
示例#2
0
 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           = Color4Extensions.FromHex("#BE0089"),
                     InnerRadius      = RANK_CIRCLE_RADIUS,
                     Current          = { Value = 1 }
                 },
                 new SmoothCircularProgress
                 {
                     RelativeSizeAxes = Axes.Both,
                     Colour           = Color4Extensions.FromHex("#0096A2"),
                     InnerRadius      = RANK_CIRCLE_RADIUS,
                     Current          = { Value = 1 - virtual_ss_percentage }
                 },
                 new SmoothCircularProgress
                 {
                     RelativeSizeAxes = Axes.Both,
                     Colour           = Color4Extensions.FromHex("#72C904"),
                     InnerRadius      = RANK_CIRCLE_RADIUS,
                     Current          = { Value = 0.95f }
                 },
                 new SmoothCircularProgress
                 {
                     RelativeSizeAxes = Axes.Both,
                     Colour           = Color4Extensions.FromHex("#D99D03"),
                     InnerRadius      = RANK_CIRCLE_RADIUS,
                     Current          = { Value = 0.9f }
                 },
                 new SmoothCircularProgress
                 {
                     RelativeSizeAxes = Axes.Both,
                     Colour           = Color4Extensions.FromHex("#EA7948"),
                     InnerRadius      = RANK_CIRCLE_RADIUS,
                     Current          = { Value = 0.8f }
                 },
                 new SmoothCircularProgress
                 {
                     RelativeSizeAxes = Axes.Both,
                     Colour           = Color4Extensions.FromHex("#FF5858"),
                     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),
             }
         },
         rankText = new RankText(score.Rank)
     };
 }