Beispiel #1
0
 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
                 },
             },
         },
     };
 }
Beispiel #2
0
        public TopScoreUserSection()
        {
            AutoSizeAxes = Axes.Both;

            InternalChild = new FillFlowContainer
            {
                AutoSizeAxes = Axes.Both,
                Direction    = FillDirection.Horizontal,
                Spacing      = new Vector2(10, 0),
                Children     = new Drawable[]
                {
                    rankText = new OsuSpriteText
                    {
                        Anchor = Anchor.Centre,
                        Origin = Anchor.Centre,
                        Text   = "#1",
                        Font   = OsuFont.GetFont(size: 30, weight: FontWeight.Bold, italics: true)
                    },
                    rank = new DrawableRank(ScoreRank.F)
                    {
                        Anchor   = Anchor.Centre,
                        Origin   = Anchor.Centre,
                        Size     = new Vector2(40),
                        FillMode = FillMode.Fit,
                    },
                    avatar = new UpdateableAvatar
                    {
                        Anchor       = Anchor.Centre,
                        Origin       = Anchor.Centre,
                        Size         = new Vector2(80),
                        Masking      = true,
                        CornerRadius = 5,
                        EdgeEffect   = new EdgeEffectParameters
                        {
                            Type   = EdgeEffectType.Shadow,
                            Colour = Color4.Black.Opacity(0.25f),
                            Offset = new Vector2(0, 2),
                            Radius = 1,
                        },
                    },
                    new FillFlowContainer
                    {
                        Anchor       = Anchor.Centre,
                        Origin       = Anchor.Centre,
                        AutoSizeAxes = Axes.Both,
                        Direction    = FillDirection.Vertical,
                        Spacing      = new Vector2(0, 3),
                        Children     = new Drawable[]
                        {
                            usernameText = new LinkFlowContainer(s => s.Font = OsuFont.GetFont(size: 20, weight: FontWeight.Bold, italics: true))
                            {
                                Anchor       = Anchor.CentreLeft,
                                Origin       = Anchor.CentreLeft,
                                AutoSizeAxes = Axes.Both,
                            },
                            date = new SpriteText
                            {
                                Anchor = Anchor.CentreLeft,
                                Origin = Anchor.CentreLeft,
                                Font   = OsuFont.GetFont(size: 15, weight: FontWeight.Bold)
                            },
                            flag = new DrawableFlag
                            {
                                Anchor = Anchor.CentreLeft,
                                Origin = Anchor.CentreLeft,
                                Size   = new Vector2(20, 13),
                            },
                        }
                    }
                }
            };
        }
Beispiel #3
0
 public DrawableTopScore()
 {
     RelativeSizeAxes = Axes.X;
     Height           = height;
     CornerRadius     = 5;
     BorderThickness  = 4;
     Masking          = true;
     Children         = new Drawable[]
     {
         background = new Box
         {
             RelativeSizeAxes = Axes.Both,
             Alpha            = 0,
             AlwaysPresent    = true, //used for correct border representation
         },
         avatar = new UpdateableAvatar
         {
             Size         = new Vector2(avatar_size),
             Masking      = true,
             CornerRadius = 5,
             EdgeEffect   = new EdgeEffectParameters
             {
                 Type   = EdgeEffectType.Shadow,
                 Colour = Color4.Black.Opacity(0.25f),
                 Offset = new Vector2(0, 2),
                 Radius = 1,
             },
             Margin = new MarginPadding {
                 Top = margin, Left = margin
             }
         },
         flag = new DrawableFlag
         {
             Size     = new Vector2(30, 20),
             Position = new Vector2(margin * 2 + avatar_size, height / 4),
         },
         username = new ClickableUsername
         {
             Origin   = Anchor.BottomLeft,
             TextSize = 30,
             Position = new Vector2(margin * 2 + avatar_size, height / 4),
             Margin   = new MarginPadding {
                 Bottom = 4
             }
         },
         rankText = new OsuSpriteText
         {
             Anchor   = Anchor.TopRight,
             Origin   = Anchor.BottomRight,
             Text     = "#1",
             TextSize = 40,
             Font     = @"Exo2.0-BoldItalic",
             Y        = height / 4,
             Margin   = new MarginPadding {
                 Right = margin
             }
         },
         date = new OsuSpriteText
         {
             Anchor = Anchor.TopRight,
             Origin = Anchor.TopRight,
             Y      = height / 4,
             Margin = new MarginPadding {
                 Right = margin
             }
         },
         new Container
         {
             Anchor           = Anchor.BottomCentre,
             Origin           = Anchor.BottomCentre,
             RelativeSizeAxes = Axes.Both,
             Height           = 0.5f,
             Children         = new Drawable[]
             {
                 bottomBackground = new Box {
                     RelativeSizeAxes = Axes.Both
                 },
                 middleLine = new Box
                 {
                     RelativeSizeAxes = Axes.X,
                     Height           = 1,
                 },
                 rank = new DrawableRank(ScoreRank.F)
                 {
                     Origin   = Anchor.BottomLeft,
                     Size     = new Vector2(avatar_size, 40),
                     FillMode = FillMode.Fit,
                     Y        = height / 4,
                     Margin   = new MarginPadding {
                         Left = margin
                     }
                 },
                 new FillFlowContainer <InfoColumn>
                 {
                     Origin       = Anchor.BottomLeft,
                     AutoSizeAxes = Axes.Both,
                     Position     = new Vector2(height / 2, height / 4),
                     Direction    = FillDirection.Horizontal,
                     Spacing      = new Vector2(15, 0),
                     Children     = new[]
                     {
                         totalScore = new InfoColumn("Score"),
                         accuracy   = new InfoColumn("Accuracy"),
                         statistics = new InfoColumn("300/100/50"),
                     },
                 },
                 modsContainer = new ScoreModsContainer
                 {
                     AutoSizeAxes = Axes.Y,
                     Width        = 80,
                     Position     = new Vector2(height / 2, height / 4),
                 }
             }
         },
     };
 }