예제 #1
0
        protected DrawableScore(Score score)
        {
            Score = score;

            RelativeSizeAxes = Axes.X;
            Height           = 60;
            Children         = new Drawable[]
            {
                background = new Container
                {
                    RelativeSizeAxes = Axes.Both,
                    Masking          = true,
                    CornerRadius     = 3,
                    Alpha            = 0,
                    EdgeEffect       = new EdgeEffectParameters
                    {
                        Type   = EdgeEffectType.Shadow,
                        Offset = new Vector2(0f, 1f),
                        Radius = 1f,
                        Colour = Color4.Black.Opacity(0.2f),
                    },
                    Child = coloredBackground = new Box {
                        RelativeSizeAxes = Axes.Both
                    }
                },
                new Container
                {
                    RelativeSizeAxes = Axes.Both,
                    Anchor           = Anchor.TopCentre,
                    Origin           = Anchor.TopCentre,
                    Width            = 0.97f,
                    Children         = new Drawable[]
                    {
                        underscoreLine = new Box
                        {
                            Anchor           = Anchor.BottomCentre,
                            Origin           = Anchor.BottomCentre,
                            RelativeSizeAxes = Axes.X,
                            Height           = 1,
                        },
                        new DrawableRank(score.Rank)
                        {
                            RelativeSizeAxes = Axes.Y,
                            Width            = 60,
                            FillMode         = FillMode.Fit,
                        },
                        Stats = new FillFlowContainer <OsuSpriteText>
                        {
                            RelativeSizeAxes = Axes.X,
                            AutoSizeAxes     = Axes.Y,
                            Anchor           = Anchor.CentreRight,
                            Origin           = Anchor.CentreRight,
                            Direction        = FillDirection.Vertical,
                        },
                        metadata = new FillFlowContainer
                        {
                            RelativeSizeAxes = Axes.X,
                            AutoSizeAxes     = Axes.Y,
                            Anchor           = Anchor.CentreLeft,
                            Origin           = Anchor.CentreLeft,
                            Margin           = new MarginPadding {
                                Left = 70
                            },
                            Direction = FillDirection.Vertical,
                            Child     = new OsuSpriteText
                            {
                                Text     = score.Date.LocalDateTime.ToShortDateString(),
                                TextSize = 11,
                                Colour   = OsuColour.Gray(0xAA),
                                Depth    = -1,
                            },
                        },
                        modsContainer = new ScoreModsContainer
                        {
                            AutoSizeAxes = Axes.Y,
                            Anchor       = Anchor.CentreRight,
                            Origin       = Anchor.CentreRight,
                            Width        = 60,
                            Margin       = new MarginPadding {
                                Right = 160
                            }
                        }
                    }
                },
            };
        }