コード例 #1
0
ファイル: HUDOverlay.cs プロジェクト: dskylh/osu
        public HUDOverlay(DrawableRuleset drawableRuleset, IReadOnlyList <Mod> mods)
        {
            this.drawableRuleset = drawableRuleset;
            this.mods            = mods;

            RelativeSizeAxes = Axes.Both;

            Children = new Drawable[]
            {
                CreateFailingLayer(),
                visibilityContainer = new Container
                {
                    RelativeSizeAxes = Axes.Both,
                    Child            = new GridContainer
                    {
                        RelativeSizeAxes = Axes.Both,
                        Content          = new[]
                        {
                            new Drawable[]
                            {
                                new Container
                                {
                                    RelativeSizeAxes = Axes.Both,
                                    Children         = new Drawable[]
                                    {
                                        HealthDisplay   = CreateHealthDisplay(),
                                        AccuracyCounter = CreateAccuracyCounter(),
                                        ScoreCounter    = CreateScoreCounter(),
                                        CreateComboCounter(),
                                        CreateHitErrorDisplayOverlay(),
                                    }
                                },
                            },
                            new Drawable[]
                            {
                                Progress = CreateProgress(),
                            }
                        },
                        RowDimensions = new[]
                        {
                            new Dimension(),
                            new Dimension(GridSizeMode.AutoSize)
                        }
                    },
                },
                topRightElements = new FillFlowContainer
                {
                    Anchor       = Anchor.TopRight,
                    Origin       = Anchor.TopRight,
                    Margin       = new MarginPadding(10),
                    Spacing      = new Vector2(10),
                    AutoSizeAxes = Axes.Both,
                    Direction    = FillDirection.Vertical,
                    Children     = new Drawable[]
                    {
                        ModDisplay            = CreateModsContainer(),
                        PlayerSettingsOverlay = CreatePlayerSettingsOverlay(),
                    }
                },
                bottomRightElements = new FillFlowContainer
                {
                    Anchor         = Anchor.BottomRight,
                    Origin         = Anchor.BottomRight,
                    Margin         = new MarginPadding(10),
                    Spacing        = new Vector2(10),
                    AutoSizeAxes   = Axes.Both,
                    LayoutDuration = FADE_DURATION / 2,
                    LayoutEasing   = FADE_EASING,
                    Direction      = FillDirection.Vertical,
                    Children       = new Drawable[]
                    {
                        KeyCounter = CreateKeyCounter(),
                        HoldToQuit = CreateHoldForMenuButton(),
                    }
                }
            };
        }